eth_sendRawTransaction

This commit is contained in:
sc0Vu 2017-12-13 23:55:12 +08:00
parent ff2c90c196
commit ea89fcbde7
2 changed files with 33 additions and 0 deletions

View File

@ -128,6 +128,13 @@ class Eth
], ],
] ]
], ],
'eth_sendRawTransaction' => [
'params' => [
[
'validators' => HexValidator::class
]
]
],
]; ];
/** /**

View File

@ -405,6 +405,32 @@ class EthTest extends TestCase
}); });
} }
/**
* testSendRawTransaction
*
* @return void
*/
public function testSendRawTransaction()
{
$eth = $this->web3->eth;
$eth->sendRawTransaction('0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675', 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)) {
// it's just test hex.
$this->assertTrue(is_string($transaction->error->message));
} else {
$this->assertTrue(true);
}
}
});
}
/** /**
* testUnallowedMethod * testUnallowedMethod
* *