Skip to content

Commit

Permalink
fix: patch up rebase I messed up lol
Browse files Browse the repository at this point in the history
  • Loading branch information
prestwich committed May 2, 2023
1 parent 052010c commit 8b4a610
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion abi/sol-type-parser/src/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl SolStructDef {

#[allow(non_snake_case)]
const _: () = {
use ::ethers_abi_enc::{SolDataType, keccak256, no_std_prelude::*};
use ::ethers_abi_enc::{SolDataType, no_std_prelude::*};

#convert

Expand Down
4 changes: 1 addition & 3 deletions abi/src/eip712.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
use crate::{
no_std_prelude::{Cow, String, Vec},
sol_data,
util::keccak256,
SolType,
sol_data, SolType,
};
use ethers_primitives::{keccak256, Address, B256, U256};

Expand Down
3 changes: 3 additions & 0 deletions abi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,9 @@ mod sol_types;
pub use sol_types::{sol_data, SolDataType, SolError, SolStruct, SolType};

mod util;

#[doc(hidden)]
pub use ethers_primitives::keccak256;
#[doc(hidden)]
pub use util::just_ok;

Expand Down
8 changes: 4 additions & 4 deletions abi/src/sol_types/sol_data.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use alloc::borrow::Cow;
use core::marker::PhantomData;
use ethers_primitives::{B160, I256, U256};
use ethers_primitives::{keccak256, Address as RustAddress, I256, U256};

#[cfg(not(feature = "std"))]
use crate::no_std_prelude::{Borrow, String as RustString, ToOwned, Vec};
#[cfg(feature = "std")]
use std::{borrow::Borrow, string::String as RustString};

use crate::{keccak256, token::*, util, AbiResult, SolType, Word};
use crate::{token::*, util, AbiResult, SolType, Word};

/// This trait describes types that exist in normal Solidity operation
/// (i.e. NOT events, errors, function calls)
Expand Down Expand Up @@ -43,7 +43,7 @@ pub trait SolDataType: SolType {
pub struct Address;

impl SolType for Address {
type RustType = B160;
type RustType = RustAddress;
type TokenType = WordToken;

fn sol_type_name() -> Cow<'static, str> {
Expand All @@ -56,7 +56,7 @@ impl SolType for Address {

fn detokenize(token: Self::TokenType) -> AbiResult<Self::RustType> {
let sli = &token.as_slice()[12..];
Ok(B160::from_slice(sli))
Ok(RustAddress::from_slice(sli))
}

fn tokenize<B>(rust: B) -> Self::TokenType
Expand Down
5 changes: 1 addition & 4 deletions abi/src/sol_types/sol_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
use ethers_primitives::{keccak256, B256};

use crate::token::TokenSeq;
use crate::{util::keccak256, SolDataType, Word};

use crate::{no_std_prelude::*, Eip712Domain};
use crate::{no_std_prelude::*, token::TokenSeq, Eip712Domain, SolDataType, Word};

use super::SolType;

Expand Down

0 comments on commit 8b4a610

Please sign in to comment.