eth_getTransactionByHash

This commit is contained in:
sc0Vu 2017-12-14 18:29:21 +08:00
parent f48df7d2c7
commit 8e4d9067f8
2 changed files with 33 additions and 1 deletions

View File

@ -182,7 +182,14 @@ class Eth
'validators' => BooleanValidator::class
]
]
],
'eth_getTransactionByHash' => [
'params' => [
[
'validators' => BlockHashValidator::class
]
]
],
];
/**

View File

@ -583,6 +583,31 @@ class EthTest extends TestCase
});
}
/**
* testGetTransactionByHash
*
* @return void
*/
public function testGetTransactionByHash()
{
$eth = $this->eth;
$eth->getTransactionByHash('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', function ($err, $transaction) {
if ($err !== null) {
return $this->fail($err->getMessage());
}
if (isset($transaction->result)) {
$this->assertTrue(is_string($transaction->result));
} else {
if (isset($transaction->error)) {
$this->fail($transaction->error->message);
} else {
$this->assertTrue(true);
}
}
});
}
/**
* testUnallowedMethod
*