Add upgrade authority command to cli
Change-Id: I58d617cbf19a8300a0915f317e63469c73e64c0f
This commit is contained in:
parent
953ca87162
commit
f9f461d78d
|
@ -61,7 +61,9 @@ use solana_sdk::{
|
||||||
use solitaire::{
|
use solitaire::{
|
||||||
processors::seeded::Seeded,
|
processors::seeded::Seeded,
|
||||||
AccountState,
|
AccountState,
|
||||||
|
Info,
|
||||||
};
|
};
|
||||||
|
use solitaire_client::Derive;
|
||||||
|
|
||||||
struct Config {
|
struct Config {
|
||||||
rpc_client: RpcClient,
|
rpc_client: RpcClient,
|
||||||
|
@ -214,6 +216,20 @@ fn main() {
|
||||||
Defaults to the client keypair.",
|
Defaults to the client keypair.",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
.subcommand(
|
||||||
|
SubCommand::with_name("upgrade-authority")
|
||||||
|
.about("Get the derived signer used for contract upgrades")
|
||||||
|
.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 bridge program address"),
|
||||||
|
)
|
||||||
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("create-bridge")
|
SubCommand::with_name("create-bridge")
|
||||||
.about("Create a new bridge")
|
.about("Create a new bridge")
|
||||||
|
@ -361,6 +377,13 @@ fn main() {
|
||||||
msg_fee_persistent,
|
msg_fee_persistent,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
("upgrade-authority", Some(arg_matches)) => {
|
||||||
|
let bridge = pubkey_of(arg_matches, "bridge").unwrap();
|
||||||
|
let upgrade_auth = <Derive<Info<'_>, "upgrade">>::key(None, &bridge);
|
||||||
|
println!("Upgrade Key: {}", upgrade_auth);
|
||||||
|
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
("post-message", Some(arg_matches)) => {
|
("post-message", Some(arg_matches)) => {
|
||||||
let bridge = pubkey_of(arg_matches, "bridge").unwrap();
|
let bridge = pubkey_of(arg_matches, "bridge").unwrap();
|
||||||
let data_str: String = value_of(arg_matches, "data").unwrap();
|
let data_str: String = value_of(arg_matches, "data").unwrap();
|
||||||
|
|
Loading…
Reference in New Issue