Skip to content

Commit

Permalink
[gh-945] format code.
Browse files Browse the repository at this point in the history
  • Loading branch information
Feliciss committed Oct 26, 2023
1 parent 0cfce08 commit b7b017a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use moveos_types::transaction::MoveAction;
use rooch_key::keystore::account_keystore::AccountKeystore;
use rooch_key::keystore::memory_keystore::InMemKeystore;
use rooch_types::framework::empty::Empty;
use rooch_types::transaction::AbstractTransaction;
use rooch_types::transaction::ethereum::EthereumTransaction;
use rooch_types::transaction::AbstractTransaction;

use crate::binding_test;

Expand All @@ -29,9 +29,11 @@ fn test_validate() {
let tx = EthereumTransaction::new_for_test(sender, sequence_number, action_bytes);

let multi_chain_address_sender = tx.sender();
let resolved_sender = address_mapping.resolve_or_generate(multi_chain_address_sender.clone()).unwrap();
let authenticator = tx.authenticator_info().unwrap();
let moveos_tx = tx.construct_moveos_transaction(resolved_sender).unwrap();
let resolved_sender = address_mapping
.resolve_or_generate(multi_chain_address_sender.clone())
.unwrap();
let authenticator = tx.authenticator_info().unwrap();
let moveos_tx = tx.construct_moveos_transaction(resolved_sender).unwrap();

ethereum_validator
.validate(&moveos_tx.ctx, authenticator.authenticator.payload)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ fn test_validate_ethereum() {
let tx = EthereumTransaction::new_for_test(sender, sequence_number, action_bytes);

let multi_chain_address_sender = tx.sender();
let resolved_sender = address_mapping.resolve_or_generate(multi_chain_address_sender.clone()).unwrap();
let authenticator = tx.authenticator_info().unwrap();
let moveos_tx = tx.construct_moveos_transaction(resolved_sender).unwrap();
let resolved_sender = address_mapping
.resolve_or_generate(multi_chain_address_sender.clone())
.unwrap();
let authenticator = tx.authenticator_info().unwrap();
let moveos_tx = tx.construct_moveos_transaction(resolved_sender).unwrap();

transaction_validator
.validate(&moveos_tx.ctx, authenticator)
Expand Down
2 changes: 1 addition & 1 deletion crates/rooch-types/src/transaction/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ impl EthereumTransaction {
block_hash: None,
block_number: None,
transaction_index: None,
from: H160::from_slice(&sender.0.0[..20]), // scrape first 20 bytes as ethereum address
from: H160::from_slice(&sender.0 .0[..20]), // scrape first 20 bytes as ethereum address
to: None,
value: U256::one(),
gas_price: None,
Expand Down
4 changes: 1 addition & 3 deletions crates/rooch-types/src/transaction/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) RoochNetwork
// SPDX-License-Identifier: Apache-2.0

use self::{
authenticator::Authenticator, rooch::RoochTransaction, ethereum::EthereumTransaction,
};
use self::{authenticator::Authenticator, ethereum::EthereumTransaction, rooch::RoochTransaction};
use crate::address::MultiChainAddress;
use anyhow::Result;
use move_core_types::account_address::AccountAddress;
Expand Down

0 comments on commit b7b017a

Please sign in to comment.