File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
solana/pyth2wormhole/client/src Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -128,4 +128,6 @@ pub enum Action {
128128 ) ]
129129 owner : String ,
130130 } ,
131+ #[ clap( about = "Print out emitter address for the specified pyth2wormhole contract" ) ]
132+ GetEmitter ,
131133}
Original file line number Diff line number Diff line change @@ -72,6 +72,16 @@ async fn main() -> Result<(), ErrBox> {
7272 let cli = Cli :: parse ( ) ;
7373 init_logging ( cli. log_level ) ;
7474
75+ // All other CLI actions make rpc requests, this one's meant to be
76+ // off-chain explicitly
77+ if let Action :: GetEmitter = cli. action {
78+ let emitter_addr = P2WEmitter :: key ( None , & cli. p2w_addr ) ;
79+ println ! ( "{}" , emitter_addr) ;
80+
81+ // Exit early
82+ return Ok ( ( ) ) ;
83+ }
84+
7585 let payer = read_keypair_file ( & * shellexpand:: tilde ( & cli. payer ) ) ?;
7686
7787 let rpc_client = RpcClient :: new_with_commitment ( cli. rpc_url . clone ( ) , cli. commitment . clone ( ) ) ;
@@ -179,6 +189,7 @@ async fn main() -> Result<(), ErrBox> {
179189 )
180190 . await ?;
181191 }
192+ Action :: GetEmitter => unreachable ! { }
182193 }
183194
184195 Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments