eth_getTransactionByBlockHashAndIndex

This commit is contained in:
sc0Vu 2017-12-14 18:59:22 +08:00
parent 8e4d9067f8
commit f13217e44d
2 changed files with 34 additions and 0 deletions

View File

@ -190,6 +190,15 @@ class Eth
] ]
] ]
], ],
'eth_getTransactionByBlockHashAndIndex' => [
'params' => [
[
'validators' => BlockHashValidator::class
], [
'validators' => QuantityValidator::class
]
]
],
]; ];
/** /**

View File

@ -608,6 +608,31 @@ class EthTest extends TestCase
}); });
} }
/**
* testGetTransactionByBlockHashAndIndex
*
* @return void
*/
public function testGetTransactionByBlockHashAndIndex()
{
$eth = $this->eth;
$eth->getTransactionByBlockHashAndIndex('0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238', '0x0', 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 * testUnallowedMethod
* *