From bb7a67d4c720df37ae4de96c7fe2dcf927b8e208 Mon Sep 17 00:00:00 2001 From: Reisen Date: Thu, 26 Aug 2021 13:44:08 +0000 Subject: [PATCH] token_bridge/client: add emitter derivation helper Change-Id: I403e421ebf46b76561c59c6cdd2aac0442a3c8d6 --- .../modules/token_bridge/client/src/main.rs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/solana/modules/token_bridge/client/src/main.rs b/solana/modules/token_bridge/client/src/main.rs index 3dedd724..f4510315 100644 --- a/solana/modules/token_bridge/client/src/main.rs +++ b/solana/modules/token_bridge/client/src/main.rs @@ -203,6 +203,20 @@ fn main() { .help("Address of the Wormhole core bridge program"), ), ) + .subcommand( + SubCommand::with_name("emitter") + .about("Get the derived emitter used for contract messages") + .arg( + Arg::with_name("bridge") + .long("bridge") + .value_name("BRIDGE_KEY") + .validator(is_pubkey_or_keypair) + .takes_value(true) + .index(1) + .required(true) + .help("Specify the token bridge program address"), + ), + ) .subcommand( SubCommand::with_name("create-meta") .about("Create token metadata") @@ -278,6 +292,13 @@ fn main() { command_create_meta(&config, &mint, name, symbol) } + ("emitter", Some(arg_matches)) => { + let bridge = pubkey_of(arg_matches, "bridge").unwrap(); + let emitter = , "emitter">>::key(None, &bridge); + println!("Emitter Key: {}", emitter); + + Ok(None) + } _ => unreachable!(), }