pub trait Client: Debug + Sync {
fn transaction_already_included(&self, hash: &H256) -> bool;
fn verify_transaction_basic(
&self,
t: &UnverifiedTransaction
) -> Result<(), Error>;
fn verify_transaction(
&self,
tx: UnverifiedTransaction
) -> Result<SignedTransaction, Error>;
fn required_gas(&self, tx: &Transaction) -> U256;
fn account_details(&self, address: &Address) -> AccountDetails;
fn transaction_type(&self, tx: &SignedTransaction) -> TransactionType;
fn decode_transaction(
&self,
transaction: &[u8]
) -> Result<UnverifiedTransaction, Error>;
}
Expand description
Verification client.
Required methods
fn transaction_already_included(&self, hash: &H256) -> bool
fn transaction_already_included(&self, hash: &H256) -> bool
Is transaction with given hash already in the blockchain?
fn verify_transaction_basic(
&self,
t: &UnverifiedTransaction
) -> Result<(), Error>
fn verify_transaction_basic(
&self,
t: &UnverifiedTransaction
) -> Result<(), Error>
Perform basic/cheap transaction verification.
This should include all cheap checks that can be done before actually checking the signature, like chain-replay protection.
This method is currently used only for verifying local transactions.
fn verify_transaction(
&self,
tx: UnverifiedTransaction
) -> Result<SignedTransaction, Error>
fn verify_transaction(
&self,
tx: UnverifiedTransaction
) -> Result<SignedTransaction, Error>
Structurarily verify given transaction.
fn required_gas(&self, tx: &Transaction) -> U256
fn required_gas(&self, tx: &Transaction) -> U256
Estimate minimal gas requirurement for given transaction.
fn account_details(&self, address: &Address) -> AccountDetails
fn account_details(&self, address: &Address) -> AccountDetails
Fetch account details for given sender.
fn transaction_type(&self, tx: &SignedTransaction) -> TransactionType
fn transaction_type(&self, tx: &SignedTransaction) -> TransactionType
Classify transaction (check if transaction is filtered by some contracts).
fn decode_transaction(
&self,
transaction: &[u8]
) -> Result<UnverifiedTransaction, Error>
fn decode_transaction(
&self,
transaction: &[u8]
) -> Result<UnverifiedTransaction, Error>
Performs pre-validation of RLP decoded transaction