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 {
128
128
) ]
129
129
owner : String ,
130
130
} ,
131
+ #[ clap( about = "Print out emitter address for the specified pyth2wormhole contract" ) ]
132
+ GetEmitter ,
131
133
}
Original file line number Diff line number Diff line change @@ -72,6 +72,16 @@ async fn main() -> Result<(), ErrBox> {
72
72
let cli = Cli :: parse ( ) ;
73
73
init_logging ( cli. log_level ) ;
74
74
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
+
75
85
let payer = read_keypair_file ( & * shellexpand:: tilde ( & cli. payer ) ) ?;
76
86
77
87
let rpc_client = RpcClient :: new_with_commitment ( cli. rpc_url . clone ( ) , cli. commitment . clone ( ) ) ;
@@ -179,6 +189,7 @@ async fn main() -> Result<(), ErrBox> {
179
189
)
180
190
. await ?;
181
191
}
192
+ Action :: GetEmitter => unreachable ! { }
182
193
}
183
194
184
195
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments