@@ -17,7 +17,7 @@ use crate::{
1717
1818sol ! (
1919 #[ sol( rpc) ]
20- contract ProxyCall {
20+ contract ExtendPyth {
2121 function getPriceUnsafe( bytes32 id) external returns ( uint8[ ] price) ;
2222 function getEmaPriceUnsafe( bytes32 id) external returns ( uint8[ ] price) ;
2323 function getPriceNoOlderThan( bytes32 id, uint age) external returns ( uint8[ ] price) ;
@@ -26,16 +26,18 @@ sol!(
2626 function getValidTimePeriod( ) external returns ( uint256 period) ;
2727 function updatePriceFeeds( bytes[ ] calldata updateData) external payable;
2828 function updatePriceFeedsIfNecessary( bytes[ ] calldata updateData, bytes32[ ] calldata priceIds, uint64[ ] calldata publishTimes) external payable;
29+
30+ function getData( ) external returns ( uint[ ] calldata data) ;
2931 }
3032) ;
3133
32- sol ! ( "../examples/proxy-calls /src/constructor.sol" ) ;
34+ sol ! ( "../examples/extend-pyth-example /src/constructor.sol" ) ;
3335
3436pub async fn bench ( ) -> eyre:: Result < ContractReport > {
3537 let reports = run_with ( CacheOpt :: None ) . await ?;
3638 let report = reports
3739 . into_iter ( )
38- . try_fold ( ContractReport :: new ( "ProxyCalls " ) , ContractReport :: add) ?;
40+ . try_fold ( ContractReport :: new ( "ExtendPyth " ) , ContractReport :: add) ?;
3941
4042 let cached_reports = run_with ( CacheOpt :: Bid ( 0 ) ) . await ?;
4143 let report = cached_reports
@@ -57,7 +59,7 @@ pub async fn run_with(
5759
5860 let contract_addr = deploy ( & alice, cache_opt) . await ?;
5961
60- let contract = ProxyCall :: new ( contract_addr, & alice_wallet) ;
62+ let contract = ExtendPyth :: new ( contract_addr, & alice_wallet) ;
6163 let id = keccak_const:: Keccak256 :: new ( ) . update ( b"ETH" ) . finalize ( ) . to_vec ( ) ;
6264 let id = TypeFixedBytes :: < 32 > :: from_slice ( & id) ;
6365 let time_frame = uint ! ( 10000_ U256 ) ;
@@ -74,7 +76,7 @@ pub async fn run_with(
7476 let _ = receipt ! ( contract. updatePriceFeeds( data. clone( ) ) ) ?;
7577
7678 // IMPORTANT: Order matters!
77- use ProxyCall :: * ;
79+ use ExtendPyth :: * ;
7880 #[ rustfmt:: skip]
7981 let receipts = vec ! [
8082 ( getPriceUnsafeCall:: SIGNATURE , receipt!( contract. getPriceUnsafe( id) ) ?) ,
@@ -97,7 +99,7 @@ async fn deploy(
9799) -> eyre:: Result < Address > {
98100 let pyth_addr = env ( "MOCK_PYTH_ADDRESS" ) ?;
99101 let address = Address :: from_str ( & pyth_addr) ?;
100- let args = ProxyCallsExample :: constructorCall { _pythAddress : address } ;
102+ let args = ExtendPythExample :: constructorCall { _pythAddress : address } ;
101103 let args = alloy:: hex:: encode ( args. abi_encode ( ) ) ;
102- crate :: deploy ( account, "proxy-calls " , Some ( args) , cache_opt) . await
104+ crate :: deploy ( account, "extend-pyth " , Some ( args) , cache_opt) . await
103105}
0 commit comments