Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Tx receipt fields (so you can see the called contract addresses… #18

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM iojs
ADD app /app
ADD .bowerrc /
ADD bower.json /
ADD karma.conf.js /
ADD package.json /
WORKDIR /
RUN npm install
ADD selectRpcAndRun.sh /
CMD /selectRpcAndRun.sh

17 changes: 12 additions & 5 deletions app/scripts/controllers/blockInfosController.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,19 @@ angular.module('ethExplorer')
input: result.input,
value: result.value
}
$scope.$apply(
$scope.transactions.push(transaction)
)
})

web3.eth.getTransactionReceipt(result.hash, function (err2, receipt) {
if(!err2) {
for (var attrname in receipt) { transaction[attrname] = receipt[attrname]; }
}

$scope.$apply(
$scope.transactions.push(transaction)
);
});
});
}
})
});


function hex2a(hexx) {
Expand Down
9 changes: 8 additions & 1 deletion app/scripts/controllers/transactionInfosController.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ angular.module('ethExplorer')
}
$scope.from = result.from;
$scope.gas = result.gas;
$scope.gasUsed = result.gasUsed;
$scope.contractAddress = result.contractAddress;
$scope.gasPrice = result.gasPrice.c[0] + " WEI";
$scope.hash = result.hash;
$scope.input = result.input; // that's a string
Expand Down Expand Up @@ -68,7 +70,12 @@ angular.module('ethExplorer')

web3.eth.getTransaction($scope.txId,function(error, result) {
if(!error){
deferred.resolve(result);
web3.eth.getTransactionReceipt($scope.txId,function(err2, receipt) {
if(!err2) {
for (var attrname in receipt) { result[attrname] = receipt[attrname]; }
}
deferred.resolve(result);
});
}
else{
deferred.reject(error);
Expand Down
10 changes: 9 additions & 1 deletion app/views/blockInfos.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,17 @@ <h2 style="margin-top: 30px;">
<td><a href="./#/address/{{tx.to}}">{{tx.to}}</a></td>
</tr>
<tr>
<td>Gas</td>
<td>Contract Address</td>
<td><a href="./#/address/{{tx.contractAddress}}">{{tx.contractAddress || '??'}}</a></td>
</tr>
<tr>
<td>Gas Sent</td>
<td>{{tx.gas}}</a></td>
</tr>
<tr>
<td>Gas Used</td>
<td>{{tx.gasUsed || '??'}}</a></td>
</tr>
<tr>
<td>Input</td>
<td>{{tx.input}}</a></td>
Expand Down
10 changes: 9 additions & 1 deletion app/views/transactionInfos.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,17 @@ <h1>Transaction
</td>
</tr>
<tr>
<td>Gas Used</td>
<td>Contract Address</td>
<td><a href="./#/address/{{contractAddress}}">{{contractAddress || '??'}}</a></td>
</tr>
<tr>
<td>Gas Sent</td>
<td>{{gas}}</td>
</tr>
<tr>
<td>Gas Used</td>
<td>{{gasUsed || '??'}}</td>
</tr>
<tr>
<td>Gas Price</td>
<td>{{gasPrice}}</td>
Expand Down
8 changes: 8 additions & 0 deletions selectRpcAndRun.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh

if [ "$WEB3_RPC" != "" ]; then
mv app/app.js app/app.js.orig
cat app/app.js.orig | sed "s|http://localhost:8545|$WEB3_RPC|" > app/app.js
fi

node_modules/http-server/bin/http-server ./app -a 0.0.0.0 -p 8000 -c-1