-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathTestCase.php
More file actions
64 lines (50 loc) · 2.08 KB
/
TestCase.php
File metadata and controls
64 lines (50 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
declare(strict_types=1);
namespace ArkEcosystem\Tests\Crypto;
use ArkEcosystem\Crypto\Configuration\Network;
use ArkEcosystem\Crypto\Networks\Testnet;
use ArkEcosystem\Crypto\Transactions\Deserializer;
use ArkEcosystem\Crypto\Transactions\Types\AbstractTransaction;
use PHPUnit\Framework\TestCase as BaseTestCase;
abstract class TestCase extends BaseTestCase
{
use Concerns\Fixtures;
use Concerns\Serialize;
use Concerns\Deserialize;
protected $address = '0x6f0182a0cc707b055322ccf6d4cb6a5aff1aeb22';
protected $passphrase = 'found lobster oblige describe ready addict body brave live vacuum display salute lizard combine gift resemble race senior quality reunion proud tell adjust angle';
protected $secondPassphrase = 'this is a top secret second passphrase';
protected $passphrases = [
'album pony urban cheap small blade cannon silent run reveal luxury glad predict excess fire beauty hollow reward solar egg exclude leaf sight degree',
'hen slogan retire boss upset blame rocket slender area arch broom bring elder few milk bounce execute page evoke once inmate pear marine deliver',
'top visa use bacon sun infant shrimp eye bridge fantasy chair sadness stable simple salad canoe raw hill target connect avoid promote spider category',
];
protected function setUp(): void
{
Network::set(Testnet::new());
}
protected function assertTransaction(array $fixture): AbstractTransaction
{
$actual = $this->assertDeserialized($fixture, [
'hash',
'nonce',
'value',
'gasPrice',
'gasLimit',
'contractId',
'senderPublicKey',
'from',
'to',
'v',
'r',
's',
]);
$this->assertTrue($actual->verify());
return $actual;
}
protected function getTransaction($file = 'transfer'): AbstractTransaction
{
$fixture = $this->getTransactionFixture('evm_call', $file);
return Deserializer::new($fixture['serialized'])->deserialize();
}
}