Fixed misstype (#10351)

* Fixed misstype

BadTransactonType => BadTransactionType

* fixed other insances of transacton
This commit is contained in:
Dan Acristinii 2019-02-14 12:25:44 +01:00 committed by Hernando Castano
parent 512343003d
commit d6c80c1672
3 changed files with 6 additions and 6 deletions

View File

@ -76,7 +76,7 @@ error_chain! {
} }
#[doc = "Wrong private transaction type."] #[doc = "Wrong private transaction type."]
BadTransactonType { BadTransactionType {
description("Wrong private transaction type."), description("Wrong private transaction type."),
display("Wrong private transaction type"), display("Wrong private transaction type"),
} }

View File

@ -241,7 +241,7 @@ impl Provider {
bail!(ErrorKind::SignerAccountNotSet); bail!(ErrorKind::SignerAccountNotSet);
} }
let tx_hash = signed_transaction.hash(); let tx_hash = signed_transaction.hash();
let contract = Self::contract_address_from_transaction(&signed_transaction).map_err(|_| ErrorKind::BadTransactonType)?; let contract = Self::contract_address_from_transaction(&signed_transaction).map_err(|_| ErrorKind::BadTransactionType)?;
let data = signed_transaction.rlp_bytes(); let data = signed_transaction.rlp_bytes();
let encrypted_transaction = self.encrypt(&contract, &Self::iv_from_transaction(&signed_transaction), &data)?; let encrypted_transaction = self.encrypt(&contract, &Self::iv_from_transaction(&signed_transaction), &data)?;
let private = PrivateTransaction::new(encrypted_transaction, contract); let private = PrivateTransaction::new(encrypted_transaction, contract);
@ -415,7 +415,7 @@ impl Provider {
Action::Call(contract) => Ok(contract), Action::Call(contract) => Ok(contract),
_ => { _ => {
warn!(target: "privatetx", "Incorrect type of action for the transaction"); warn!(target: "privatetx", "Incorrect type of action for the transaction");
bail!(ErrorKind::BadTransactonType); bail!(ErrorKind::BadTransactionType);
} }
} }
} }
@ -610,7 +610,7 @@ impl Provider {
/// Create encrypted public contract deployment transaction. /// Create encrypted public contract deployment transaction.
pub fn public_creation_transaction(&self, block: BlockId, source: &SignedTransaction, validators: &[Address], gas_price: U256) -> Result<(Transaction, Address), Error> { pub fn public_creation_transaction(&self, block: BlockId, source: &SignedTransaction, validators: &[Address], gas_price: U256) -> Result<(Transaction, Address), Error> {
if let Action::Call(_) = source.action { if let Action::Call(_) = source.action {
bail!(ErrorKind::BadTransactonType); bail!(ErrorKind::BadTransactionType);
} }
let sender = source.sender(); let sender = source.sender();
let state = self.client.state_at(block).ok_or(ErrorKind::StatePruned)?; let state = self.client.state_at(block).ok_or(ErrorKind::StatePruned)?;
@ -649,7 +649,7 @@ impl Provider {
/// Create encrypted public contract deployment transaction. Returns updated encrypted state. /// Create encrypted public contract deployment transaction. Returns updated encrypted state.
pub fn execute_private_transaction(&self, block: BlockId, source: &SignedTransaction) -> Result<Bytes, Error> { pub fn execute_private_transaction(&self, block: BlockId, source: &SignedTransaction) -> Result<Bytes, Error> {
if let Action::Create = source.action { if let Action::Create = source.action {
bail!(ErrorKind::BadTransactonType); bail!(ErrorKind::BadTransactionType);
} }
let result = self.execute_private(source, TransactOptions::with_no_tracing(), block)?; let result = self.execute_private(source, TransactOptions::with_no_tracing(), block)?;
Ok(result.state) Ok(result.state)

View File

@ -97,7 +97,7 @@ fn should_return_correct_nonces_when_dropped_because_of_limit() {
Ok(()) Ok(())
]); ]);
assert_eq!(txq.status().status.transaction_count, 3); assert_eq!(txq.status().status.transaction_count, 3);
// tx2 transacton got dropped because of limit // tx2 transaction got dropped because of limit
// tx1 and tx1' are kept, because they have lower insertion_ids so they are preferred. // tx1 and tx1' are kept, because they have lower insertion_ids so they are preferred.
assert_eq!(txq.next_nonce(TestClient::new(), &sender), None); assert_eq!(txq.next_nonce(TestClient::new(), &sender), None);
} }