Fix: Non-static method Web3\Contracts\Ethabi::encodeEventSignature() should not be called statically

This commit is contained in:
sc0Vu 2018-01-12 18:05:52 +08:00
parent ac5e46ba2a
commit b16a8f9b9a
2 changed files with 13 additions and 3 deletions

View File

@ -243,7 +243,7 @@ class Contract
} }
/** /**
* getAbr * getAbi
* *
* @return array * @return array
*/ */
@ -252,6 +252,16 @@ class Contract
return $this->abi; return $this->abi;
} }
/**
* getEthabi
*
* @return array
*/
public function getEthabi()
{
return $this->ethabi;
}
/** /**
* getEth * getEth
* *

View File

@ -416,7 +416,7 @@ class ContractTest extends TestCase
$transactionId = $result; $transactionId = $result;
$this->assertTrue((preg_match('/^0x[a-f0-9]{64}$/', $transactionId) === 1)); $this->assertTrue((preg_match('/^0x[a-f0-9]{64}$/', $transactionId) === 1));
$contract->eth->getTransactionReceipt($transactionId, function ($err, $transaction) use ($fromAccount, $toAccount) { $contract->eth->getTransactionReceipt($transactionId, function ($err, $transaction) use ($fromAccount, $toAccount, $contract) {
if ($err !== null) { if ($err !== null) {
return $this->fail($err); return $this->fail($err);
} }
@ -425,7 +425,7 @@ class ContractTest extends TestCase
echo "\nTransaction has mind:) block number: " . $transaction->blockNumber . "\n"; echo "\nTransaction has mind:) block number: " . $transaction->blockNumber . "\n";
// validate topics // validate topics
$this->assertEquals(Ethabi::encodeEventSignature($this->contract->events['Transfer']), $topics[0]); $this->assertEquals($contract->ethabi->encodeEventSignature($this->contract->events['Transfer']), $topics[0]);
$this->assertEquals('0x' . IntegerFormatter::format($fromAccount), $topics[1]); $this->assertEquals('0x' . IntegerFormatter::format($fromAccount), $topics[1]);
$this->assertEquals('0x' . IntegerFormatter::format($toAccount), $topics[2]); $this->assertEquals('0x' . IntegerFormatter::format($toAccount), $topics[2]);
} }