token_bridge/client: add emitter derivation helper
Change-Id: I403e421ebf46b76561c59c6cdd2aac0442a3c8d6
This commit is contained in:
parent
6e3e43d35b
commit
bb7a67d4c7
|
@ -203,6 +203,20 @@ fn main() {
|
||||||
.help("Address of the Wormhole core bridge program"),
|
.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(
|
||||||
SubCommand::with_name("create-meta")
|
SubCommand::with_name("create-meta")
|
||||||
.about("Create token metadata")
|
.about("Create token metadata")
|
||||||
|
@ -278,6 +292,13 @@ fn main() {
|
||||||
|
|
||||||
command_create_meta(&config, &mint, name, symbol)
|
command_create_meta(&config, &mint, name, symbol)
|
||||||
}
|
}
|
||||||
|
("emitter", Some(arg_matches)) => {
|
||||||
|
let bridge = pubkey_of(arg_matches, "bridge").unwrap();
|
||||||
|
let emitter = <Derive<Info<'_>, "emitter">>::key(None, &bridge);
|
||||||
|
println!("Emitter Key: {}", emitter);
|
||||||
|
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
|
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue