Add handling for fallible signers (#8367) (#8374)

automerge
This commit is contained in:
mergify[bot]
2020-02-21 01:45:13 -08:00
committed by GitHub
parent c2b17c7d3f
commit c2be9fdf0e
11 changed files with 188 additions and 86 deletions

View File

@@ -36,7 +36,7 @@ use solana_sdk::{
message::Message,
native_token::lamports_to_sol,
pubkey::Pubkey,
signature::{keypair_from_seed, Keypair, Signature, Signer},
signature::{keypair_from_seed, Keypair, Signature, Signer, SignerError},
system_instruction::{self, create_address_with_seed, SystemError, MAX_ADDRESS_SEED_LEN},
system_transaction,
transaction::{Transaction, TransactionError},
@@ -1975,7 +1975,7 @@ impl Signer for FaucetKeypair {
self.transaction.message().account_keys[0]
}
fn try_pubkey(&self) -> Result<Pubkey, Box<dyn error::Error>> {
fn try_pubkey(&self) -> Result<Pubkey, SignerError> {
Ok(self.pubkey())
}
@@ -1983,7 +1983,7 @@ impl Signer for FaucetKeypair {
self.transaction.signatures[0]
}
fn try_sign_message(&self, message: &[u8]) -> Result<Signature, Box<dyn error::Error>> {
fn try_sign_message(&self, message: &[u8]) -> Result<Signature, SignerError> {
Ok(self.sign_message(message))
}
}