Merge pull request #104 from sinabs/master
getTransactionReceipt result maybe null
This commit is contained in:
commit
53b5165062
46
src/Eth.php
46
src/Eth.php
@ -16,6 +16,52 @@ use Web3\Providers\HttpProvider;
|
|||||||
use Web3\RequestManagers\RequestManager;
|
use Web3\RequestManagers\RequestManager;
|
||||||
use Web3\RequestManagers\HttpRequestManager;
|
use Web3\RequestManagers\HttpRequestManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class Eth
|
||||||
|
* @package Web3
|
||||||
|
* @method int protocolVersion($callback)
|
||||||
|
* @method object|false eth_syncing($callback)
|
||||||
|
* @method string coinbase($callback)
|
||||||
|
* @method boolean mining($callback)
|
||||||
|
* @method string hashrate($callback)
|
||||||
|
* @method string gasPrice($callback)
|
||||||
|
* @method array accounts($callback)
|
||||||
|
* @method string blockNumber($callback)
|
||||||
|
* @method string getBalance(...$paramsAndcallback)
|
||||||
|
* @method string getStorageAt(...$paramsAndcallback)
|
||||||
|
* @method string getTransactionCount(...$paramsAndcallback)
|
||||||
|
* @method string getBlockTransactionCountByHash(...$paramsAndcallback)
|
||||||
|
* @method string getBlockTransactionCountByNumber(...$paramsAndcallback)
|
||||||
|
* @method string getUncleCountByBlockHash(...$paramsAndcallback)
|
||||||
|
* @method string getUncleCountByBlockNumber(...$paramsAndcallback)
|
||||||
|
* @method string getUncleByBlockHashAndIndex(...$paramsAndcallback)
|
||||||
|
* @method string getUncleByBlockNumberAndIndex(...$paramsAndcallback)
|
||||||
|
* @method string getCode(...$paramsAndcallback)
|
||||||
|
* @method string sign(...$paramsAndcallback)
|
||||||
|
* @method string sendTransaction(...$paramsAndcallback)
|
||||||
|
* @method string sendRawTransaction(...$paramsAndcallback)
|
||||||
|
* @method string call(...$paramsAndcallback)
|
||||||
|
* @method string estimateGas(...$paramsAndcallback)
|
||||||
|
* @method string getBlockByHash(...$paramsAndcallback)
|
||||||
|
* @method string getBlockByNumber(...$paramsAndcallback)
|
||||||
|
* @method string getTransactionByHash(...$paramsAndcallback)
|
||||||
|
* @method string getTransactionByBlockHashAndIndex(...$paramsAndcallback)
|
||||||
|
* @method string getTransactionReceipt(...$paramsAndcallback)
|
||||||
|
* @method string getCompilers(...$paramsAndcallback)
|
||||||
|
* @method string compileSolidity(...$paramsAndcallback)
|
||||||
|
* @method string compileLLL(...$paramsAndcallback)
|
||||||
|
* @method string compileSerpent(...$paramsAndcallback)
|
||||||
|
* @method string getWork(...$paramsAndcallback)
|
||||||
|
* @method string newFilter(...$paramsAndcallback)
|
||||||
|
* @method string newBlockFilter(...$paramsAndcallback)
|
||||||
|
* @method string newPendingTransactionFilter(...$paramsAndcallback)
|
||||||
|
* @method string uninstallFilter(...$paramsAndcallback)
|
||||||
|
* @method string getFilterChanges(...$paramsAndcallback)
|
||||||
|
* @method string getFilterLogs(...$paramsAndcallback)
|
||||||
|
* @method string getLogs(...$paramsAndcallback)
|
||||||
|
* @method string submitWork(...$paramsAndcallback)
|
||||||
|
* @method string submitHashrate(...$paramsAndcallback)
|
||||||
|
*/
|
||||||
class Eth
|
class Eth
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -15,7 +15,14 @@ use Web3\Providers\Provider;
|
|||||||
use Web3\Providers\HttpProvider;
|
use Web3\Providers\HttpProvider;
|
||||||
use Web3\RequestManagers\RequestManager;
|
use Web3\RequestManagers\RequestManager;
|
||||||
use Web3\RequestManagers\HttpRequestManager;
|
use Web3\RequestManagers\HttpRequestManager;
|
||||||
|
/**
|
||||||
|
* Class Personal
|
||||||
|
* @package Web3
|
||||||
|
* @method array listAccounts($callback)
|
||||||
|
* @method array newAccount(...$paramsAndcallback)
|
||||||
|
* @method boolean unlockAccount(...$paramsAndcallback)
|
||||||
|
* @method string sendTransaction(...$paramsAndcallback)
|
||||||
|
*/
|
||||||
class Personal
|
class Personal
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -89,7 +89,7 @@ class HttpRequestManager extends RequestManager implements IRequestManager
|
|||||||
$errors = [];
|
$errors = [];
|
||||||
|
|
||||||
foreach ($json as $result) {
|
foreach ($json as $result) {
|
||||||
if (isset($result->result)) {
|
if (property_exists($result,'result')) {
|
||||||
$results[] = $result->result;
|
$results[] = $result->result;
|
||||||
} else {
|
} else {
|
||||||
if (isset($json->error)) {
|
if (isset($json->error)) {
|
||||||
@ -105,7 +105,7 @@ class HttpRequestManager extends RequestManager implements IRequestManager
|
|||||||
} else {
|
} else {
|
||||||
call_user_func($callback, null, $results);
|
call_user_func($callback, null, $results);
|
||||||
}
|
}
|
||||||
} elseif (isset($json->result)) {
|
} elseif (property_exists($json,'result')) {
|
||||||
call_user_func($callback, null, $json->result);
|
call_user_func($callback, null, $json->result);
|
||||||
} else {
|
} else {
|
||||||
if (isset($json->error)) {
|
if (isset($json->error)) {
|
||||||
|
@ -457,7 +457,7 @@ class EthApiTest extends TestCase
|
|||||||
if ($err !== null) {
|
if ($err !== null) {
|
||||||
return $this->assertTrue($err !== null);
|
return $this->assertTrue($err !== null);
|
||||||
}
|
}
|
||||||
$this->assertTrue($transaction !== null);
|
$this->assertTrue($transaction == null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -474,7 +474,7 @@ class EthApiTest extends TestCase
|
|||||||
if ($err !== null) {
|
if ($err !== null) {
|
||||||
return $this->assertTrue($err !== null);
|
return $this->assertTrue($err !== null);
|
||||||
}
|
}
|
||||||
$this->assertTrue($transaction !== null);
|
$this->assertTrue($transaction == null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -508,7 +508,7 @@ class EthApiTest extends TestCase
|
|||||||
if ($err !== null) {
|
if ($err !== null) {
|
||||||
return $this->assertTrue($err !== null);
|
return $this->assertTrue($err !== null);
|
||||||
}
|
}
|
||||||
$this->assertTrue($transaction !== null);
|
$this->assertTrue($transaction == null);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user