Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 84f2f33

Browse files
committed
spl-token-cli: Use CLI config wallet for nonce authority fallback
1 parent 25a6a6e commit 84f2f33

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

token/cli/src/main.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,16 +1954,23 @@ fn main() {
19541954
eprintln!("error: {}", e);
19551955
exit(1);
19561956
});
1957-
let (signer, nonce_authority) =
1958-
signer_of(&matches, NONCE_AUTHORITY_ARG.name, &mut wallet_manager).unwrap_or_else(
1959-
|e| {
1960-
eprintln!("error: {}", e);
1961-
exit(1);
1962-
},
1963-
);
1964-
if signer.is_some() {
1965-
bulk_signers.push(signer);
1966-
}
1957+
let (signer, nonce_authority) = signer_from_path(
1958+
&matches,
1959+
matches
1960+
.value_of(NONCE_AUTHORITY_ARG.name)
1961+
.unwrap_or(&cli_config.keypair_path),
1962+
NONCE_AUTHORITY_ARG.name,
1963+
&mut wallet_manager,
1964+
)
1965+
.map(|s| {
1966+
let p = s.pubkey();
1967+
(Some(s), Some(p))
1968+
})
1969+
.unwrap_or_else(|e| {
1970+
eprintln!("error: {}", e);
1971+
exit(1);
1972+
});
1973+
bulk_signers.push(signer);
19671974

19681975
let blockhash_query = BlockhashQuery::new_from_matches(matches);
19691976
let sign_only = matches.is_present(SIGN_ONLY_ARG.name);

0 commit comments

Comments
 (0)