Skip to content

Commit 5e38857

Browse files
committed
Not perfectly working test
1 parent 921def0 commit 5e38857

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[submodule "lazer/evm/lib/openzeppelin-contracts-upgradeable"]
88
path = lazer/evm/lib/openzeppelin-contracts-upgradeable
99
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
10+
branch = remove-realtime-channel-js
1011
[submodule "price_feeds/evm/pyth_sample/lib/forge-std"]
1112
path = price_feeds/evm/pyth_sample/lib/forge-std
1213
url = https://github.com/foundry-rs/forge-std

lazer/evm/lib/pyth-crosschain

Submodule pyth-crosschain updated 486 files

lazer/evm/src/ExampleReceiver.sol

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ contract ExampleReceiver {
99
PythLazer pythLazer;
1010
uint64 public price;
1111
uint64 public timestamp;
12+
int16 public exponent;
13+
uint16 public publisher_count;
1214

1315
constructor(address pythLazerAddress) {
1416
pythLazer = PythLazer(pythLazerAddress);
@@ -59,10 +61,12 @@ contract ExampleReceiver {
5961
int16 _exponent;
6062
(_exponent, pos) = PythLazerLib.parseFeedValueInt16(payload, pos);
6163
console.log("exponent %d", _exponent);
64+
exponent = _exponent;
6265
} else if (property == PythLazerLib.PriceFeedProperty.PublisherCount) {
63-
int16 _publisher_count;
66+
uint16 _publisher_count;
6467
(_publisher_count, pos) = PythLazerLib.parseFeedValueUint16(payload, pos);
6568
console.log("publisher count %d", _publisher_count);
69+
publisher_count = _publisher_count;
6670
} else {
6771
revert("unknown property");
6872
}

lazer/evm/test/ExampleReceiver.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ contract ExampleReceiverTest is Test {
99
function setUp() public {}
1010

1111
function test_1() public {
12-
address trustedSigner = 0xEfEf56cD66896f6799A90A4e4d512C330c094e44;
12+
address trustedSigner = 0xb8d50f0bAE75BF6E03c104903d7C3aFc4a6596Da;
1313
console.log("trustedSigner %s", trustedSigner);
1414

1515
address lazer = makeAddr("lazer");
@@ -34,7 +34,7 @@ contract ExampleReceiverTest is Test {
3434
assertEq(receiver.timestamp(), 1738270008001000);
3535
assertEq(receiver.price(), 100000000);
3636
assertEq(receiver.exponent(), -8);
37-
assertEq(receiver.publisherCount(), 1);
37+
assertEq(receiver.publisher_count(), 1);
3838

3939
assertEq(address(pythLazer).balance, fee);
4040
assertEq(address(receiver).balance, 0);

0 commit comments

Comments
 (0)