@@ -3,18 +3,26 @@ pragma solidity ^0.8.13;
33
44import {Test, console} from "forge-std/Test.sol " ;
55import {PythLazer} from "../src/PythLazer.sol " ;
6+ import "@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol " ;
67
78contract PythLazerTest is Test {
89 PythLazer public pythLazer;
10+ address owner;
911
1012 function setUp () public {
11- pythLazer = new PythLazer ();
12- pythLazer.initialize (address (1 ));
13+ owner = address (1 );
14+ PythLazer pythLazerImpl = new PythLazer ();
15+ TransparentUpgradeableProxy proxy = new TransparentUpgradeableProxy (
16+ address (pythLazerImpl),
17+ owner,
18+ abi.encodeWithSelector (PythLazer.initialize.selector , owner)
19+ );
20+ pythLazer = PythLazer (address (proxy));
1321 }
1422
1523 function test_update_add_signer () public {
1624 assert (! pythLazer.isValidSigner (address (2 )));
17- vm.prank (address ( 1 ) );
25+ vm.prank (owner );
1826 pythLazer.updateTrustedSigner (address (2 ), block .timestamp + 1000 );
1927 assert (pythLazer.isValidSigner (address (2 )));
2028 skip (2000 );
@@ -23,19 +31,19 @@ contract PythLazerTest is Test {
2331
2432 function test_update_remove_signer () public {
2533 assert (! pythLazer.isValidSigner (address (2 )));
26- vm.prank (address ( 1 ) );
34+ vm.prank (owner );
2735 pythLazer.updateTrustedSigner (address (2 ), block .timestamp + 1000 );
2836 assert (pythLazer.isValidSigner (address (2 )));
2937
30- vm.prank (address ( 1 ) );
38+ vm.prank (owner );
3139 pythLazer.updateTrustedSigner (address (2 ), 0 );
3240 assert (! pythLazer.isValidSigner (address (2 )));
3341 }
3442
3543 function test_verify () public {
3644 // Prepare dummy update and signer
3745 address trustedSigner = 0xb8d50f0bAE75BF6E03c104903d7C3aFc4a6596Da ;
38- vm.prank (address ( 1 ) );
46+ vm.prank (owner );
3947 pythLazer.updateTrustedSigner (trustedSigner, 3000000000000000 );
4048 bytes
4149 memory update = hex "2a22999a9ee4e2a3df5affd0ad8c7c46c96d3b5ef197dd653bedd8f44a4b6b69b767fbc66341e80b80acb09ead98c60d169b9a99657ebada101f447378f227bffbc69d3d01003493c7d37500062cf28659c1e801010000000605000000000005f5e10002000000000000000001000000000000000003000104fff8 " ;
0 commit comments