eth_getTransactionByHash
This commit is contained in:
parent
f48df7d2c7
commit
8e4d9067f8
@ -182,7 +182,14 @@ class Eth
|
|||||||
'validators' => BooleanValidator::class
|
'validators' => BooleanValidator::class
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
],
|
||||||
|
'eth_getTransactionByHash' => [
|
||||||
|
'params' => [
|
||||||
|
[
|
||||||
|
'validators' => BlockHashValidator::class
|
||||||
|
]
|
||||||
|
]
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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
|
* testUnallowedMethod
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user