File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,9 @@ library PythLazerLib {
8
8
enum PriceFeedProperty {
9
9
Price,
10
10
BestBidPrice,
11
- BestAskPrice
11
+ BestAskPrice,
12
+ PublisherCount,
13
+ Exponent
12
14
}
13
15
14
16
enum Channel {
@@ -74,6 +76,24 @@ library PythLazerLib {
74
76
new_pos = pos;
75
77
}
76
78
79
+ function parseFeedValueUint16 (
80
+ bytes calldata update ,
81
+ uint16 pos
82
+ ) public pure returns (uint16 value , uint16 new_pos ) {
83
+ value = uint16 (bytes2 (update[pos:pos + 2 ]));
84
+ pos += 2 ;
85
+ new_pos = pos;
86
+ }
87
+
88
+ function parseFeedValueInt16 (
89
+ bytes calldata update ,
90
+ uint16 pos
91
+ ) public pure returns (int16 value , uint16 new_pos ) {
92
+ value = int16 (uint16 (bytes2 (update[pos:pos + 2 ])));
93
+ pos += 2 ;
94
+ new_pos = pos;
95
+ }
96
+
77
97
function parseFeedValueUint8 (
78
98
bytes calldata update ,
79
99
uint16 pos
Original file line number Diff line number Diff line change @@ -34,11 +34,11 @@ contract PythLazerTest is Test {
34
34
35
35
function test_verify () public {
36
36
// Prepare dummy update and signer
37
- address trustedSigner = 0xEfEf56cD66896f6799A90A4e4d512C330c094e44 ;
37
+ address trustedSigner = 0xb8d50f0bAE75BF6E03c104903d7C3aFc4a6596Da ;
38
38
vm.prank (address (1 ));
39
39
pythLazer.updateTrustedSigner (trustedSigner, 3000000000000000 );
40
40
bytes
41
- memory update = hex "2a22999a577d3cc0202197939d736bc0dcf71b9dde7b9470e4d16fa8e2120c0787a1c0d744d0c39cc372af4d1ecf2d09e84160ca905f3f597d20e2eec144a446a0459ad600001c93c7d3750006240af373971c01010000000201000000000005f5e100 " ;
41
+ memory update = hex "2a22999a9ee4e2a3df5affd0ad8c7c46c96d3b5ef197dd653bedd8f44a4b6b69b767fbc66341e80b80acb09ead98c60d169b9a99657ebada101f447378f227bffbc69d3d01003493c7d37500062cf28659c1e801010000000605000000000005f5e10002000000000000000001000000000000000003000104fff8 " ;
42
42
43
43
uint256 fee = pythLazer.verification_fee ();
44
44
You can’t perform that action at this time.
0 commit comments