Fixed some weird cases for TestRPC and getTransaction.

This commit is contained in:
Richard Moore 2017-11-18 18:00:36 -05:00
parent e8b23c29a5
commit 5a837e1b0a
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295
2 changed files with 7 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ethers-providers",
"version": "2.1.10",
"version": "2.1.11",
"description": "Service provider for Ethereum wallet library.",
"bugs": {
"url": "http://github.com/ethers-io/ethers.js/issues",

View File

@ -188,6 +188,12 @@ function checkTransaction(transaction) {
transaction.gasLimit = transaction.gas;
}
// Some clients (TestRPC) do strange things like return 0x0 for the
// 0 address; correct this to be a real address
if (transaction.to && utils.bigNumberify(transaction.to).isZero) {
transaction.to = '0x0000000000000000000000000000000000000000';
}
// Rename input to data
if (transaction.input != null && transaction.data == null) {
transaction.data = transaction.input;