MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / sign_transaction

Method sign_transaction

web3/src/account.rs:65–74  ·  view source on GitHub ↗
(
        &self,
        transaction: Transaction,
        key: SecretKey,
    )

Source from the content-addressed store, hash-verified

63 }
64
65 pub fn sign_transaction(
66 &self,
67 transaction: Transaction,
68 key: SecretKey,
69 ) -> Result<SignedTransaction> {
70 let signed_transaction = transaction.sign(key).map_err(|e| {
71 Web3Error::TransactionSigningError(format!("{:?} {}", transaction.hash, e))
72 })?;
73 Ok(signed_transaction)
74 }
75
76 /// Retrieve the eth balance for an accout at a given block.
77 ///

Calls 1

signMethod · 0.80

Tested by

no test coverage detected