eth_getCode
This commit is contained in:
parent
c957f36217
commit
6f28fc79dc
12
src/Eth.php
12
src/Eth.php
@ -106,6 +106,18 @@ class Eth
|
||||
]
|
||||
]
|
||||
],
|
||||
'eth_getCode' => [
|
||||
'params'=> [
|
||||
[
|
||||
'validators' => AddressValidator::class,
|
||||
], [
|
||||
'default' => 'latest',
|
||||
'validators' => [
|
||||
TagValidator::class, QuantityValidator::class,
|
||||
]
|
||||
],
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -362,6 +362,27 @@ class EthTest extends TestCase
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* testGetCode
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testGetCode()
|
||||
{
|
||||
$eth = $this->web3->eth;
|
||||
|
||||
$eth->getCode('0x407d73d8a49eeb85d32cf465507dd71d507100c1', function ($err, $code) {
|
||||
if ($err !== null) {
|
||||
return $this->fail($err->getMessage());
|
||||
}
|
||||
if (isset($code->result)) {
|
||||
$this->assertTrue(is_string($code->result));
|
||||
} else {
|
||||
$this->fail($code->error->message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* testUnallowedMethod
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user