Skip to content

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
sc0Vu committed Aug 31, 2023
1 parent ef9ca98 commit cc5e9a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions test/unit/ContractTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,6 @@ public function testIssue134()
});
}

//
/**
* testAsync
*
Expand Down Expand Up @@ -1574,7 +1573,7 @@ public function testAsync()
$promise1 = $asyncContract->at($this->contractAddress)->send('transfer', $toAccount, 16, [
'from' => $fromAccount,
'gas' => '0x200b20'
], function ($err, $result) use ($contract, $fromAccount, $toAccount) {
], function ($err, $result) use ($contract, $fromAccount, $toAccount, $asyncContract) {
if ($err !== null) {
return $this->fail($err->getMessage());
}
Expand Down Expand Up @@ -1618,7 +1617,7 @@ public function testAsync()

$this->assertTrue($promise2 instanceof \React\Promise\PromiseInterface);

$promise3 = $contract->bytecode($this->testBytecode)->estimateGas(10000, 'Game Token', 1, 'GT', [
$promise3 = $asyncContract->bytecode($this->testBytecode)->estimateGas('balanceOf', $toAccount, [
'from' => $fromAccount,
'gas' => '0x200b20'
], function ($err, $result) use ($contract) {
Expand All @@ -1631,9 +1630,9 @@ public function testAsync()
}
});
\React\Async\await(\React\Async\parallel([
function () { return $promise1; },
function () { return $promise2; },
function () { return $promise3; },
function () use ($promise1) { return $promise1; },
function () use ($promise2) { return $promise2; },
function () use ($promise3) { return $promise3; },
]));
}
}
2 changes: 1 addition & 1 deletion test/unit/EthApiTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public function testGetTransactionByBlockNumberAndIndex()

$eth->getTransactionByBlockNumberAndIndex('0xe8', '0x0', function ($err, $transaction) {
if ($err !== null) {
return $this->assertEquals('LevelUpArrayAdapter named \'blocks\' index out of range: index 232; length: 15', $err->getMessage());
return $this->assertStringStartsWith('LevelUpArrayAdapter named \'blocks\' index out of range', $err->getMessage());
}
$this->assertTrue($transaction !== null);
});
Expand Down

0 comments on commit cc5e9a2

Please sign in to comment.