chore(clippy): fix newest nightly lints (#1298)
This commit is contained in:
parent
2883ed7e2d
commit
cffcc7bbec
|
@ -19,7 +19,7 @@ pub fn decode_logs<T: EthLogDecode>(logs: &[RawLog]) -> Result<Vec<T>, Error> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Metadata inside a log
|
/// Metadata inside a log
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct LogMeta {
|
pub struct LogMeta {
|
||||||
/// Address from which this log originated
|
/// Address from which this log originated
|
||||||
pub address: Address,
|
pub address: Address,
|
||||||
|
|
|
@ -9,7 +9,7 @@ use ethers_core::{
|
||||||
fn assert_tokenizeable<T: Tokenizable>() {}
|
fn assert_tokenizeable<T: Tokenizable>() {}
|
||||||
fn assert_ethcall<T: EthCall>() {}
|
fn assert_ethcall<T: EthCall>() {}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType)]
|
||||||
struct ValueChanged {
|
struct ValueChanged {
|
||||||
old_author: Address,
|
old_author: Address,
|
||||||
new_author: Address,
|
new_author: Address,
|
||||||
|
@ -23,7 +23,7 @@ struct ValueChangedWrapper {
|
||||||
msg: String,
|
msg: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType)]
|
||||||
struct ValueChangedTuple(Address, Address, String, String);
|
struct ValueChangedTuple(Address, Address, String, String);
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType)]
|
#[derive(Debug, Clone, PartialEq, EthAbiType)]
|
||||||
|
@ -49,13 +49,13 @@ fn can_detokenize_struct() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_derive_abi_type_empty_struct() {
|
fn can_derive_abi_type_empty_struct() {
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType)]
|
||||||
struct Call();
|
struct Call();
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType)]
|
||||||
struct Call2 {};
|
struct Call2 {};
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType)]
|
||||||
struct Call3;
|
struct Call3;
|
||||||
|
|
||||||
assert_tokenizeable::<Call>();
|
assert_tokenizeable::<Call>();
|
||||||
|
@ -130,7 +130,7 @@ fn can_detokenize_single_field() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_derive_eth_event() {
|
fn can_derive_eth_event() {
|
||||||
#[derive(Debug, Clone, PartialEq, EthEvent)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthEvent)]
|
||||||
struct ValueChangedEvent {
|
struct ValueChangedEvent {
|
||||||
old_author: Address,
|
old_author: Address,
|
||||||
new_author: Address,
|
new_author: Address,
|
||||||
|
@ -157,7 +157,7 @@ fn can_derive_eth_event() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_set_eth_event_name_attribute() {
|
fn can_set_eth_event_name_attribute() {
|
||||||
#[derive(Debug, PartialEq, EthEvent)]
|
#[derive(Debug, PartialEq, Eq, EthEvent)]
|
||||||
#[ethevent(name = "MyEvent")]
|
#[ethevent(name = "MyEvent")]
|
||||||
struct ValueChangedEvent {
|
struct ValueChangedEvent {
|
||||||
old_author: Address,
|
old_author: Address,
|
||||||
|
@ -172,7 +172,7 @@ fn can_set_eth_event_name_attribute() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_detect_various_event_abi_types() {
|
fn can_detect_various_event_abi_types() {
|
||||||
#[derive(Debug, PartialEq, EthEvent)]
|
#[derive(Debug, PartialEq, Eq, EthEvent)]
|
||||||
struct ValueChangedEvent {
|
struct ValueChangedEvent {
|
||||||
old_author: Address,
|
old_author: Address,
|
||||||
s: String,
|
s: String,
|
||||||
|
@ -204,7 +204,7 @@ fn can_detect_various_event_abi_types() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_set_eth_abi_attribute() {
|
fn can_set_eth_abi_attribute() {
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType)]
|
||||||
struct SomeType {
|
struct SomeType {
|
||||||
inner: Address,
|
inner: Address,
|
||||||
msg: String,
|
msg: String,
|
||||||
|
@ -242,7 +242,7 @@ fn can_set_eth_abi_attribute() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_derive_indexed_and_anonymous_attribute() {
|
fn can_derive_indexed_and_anonymous_attribute() {
|
||||||
#[derive(Debug, PartialEq, EthEvent)]
|
#[derive(Debug, PartialEq, Eq, EthEvent)]
|
||||||
#[ethevent(anonymous)]
|
#[ethevent(anonymous)]
|
||||||
struct ValueChangedEvent {
|
struct ValueChangedEvent {
|
||||||
old_author: Address,
|
old_author: Address,
|
||||||
|
@ -280,7 +280,7 @@ fn can_generate_ethevent_from_json() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_decode_event_with_no_topics() {
|
fn can_decode_event_with_no_topics() {
|
||||||
#[derive(Debug, PartialEq, EthEvent)]
|
#[derive(Debug, PartialEq, Eq, EthEvent)]
|
||||||
pub struct LiquidateBorrow {
|
pub struct LiquidateBorrow {
|
||||||
liquidator: Address,
|
liquidator: Address,
|
||||||
borrower: Address,
|
borrower: Address,
|
||||||
|
@ -310,7 +310,7 @@ fn can_decode_event_with_no_topics() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_decode_event_single_param() {
|
fn can_decode_event_single_param() {
|
||||||
#[derive(Debug, PartialEq, EthEvent)]
|
#[derive(Debug, PartialEq, Eq, EthEvent)]
|
||||||
pub struct OneParam {
|
pub struct OneParam {
|
||||||
#[ethevent(indexed)]
|
#[ethevent(indexed)]
|
||||||
param1: U256,
|
param1: U256,
|
||||||
|
@ -330,7 +330,7 @@ fn can_decode_event_single_param() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_decode_event_tuple_single_param() {
|
fn can_decode_event_tuple_single_param() {
|
||||||
#[derive(Debug, PartialEq, EthEvent)]
|
#[derive(Debug, PartialEq, Eq, EthEvent)]
|
||||||
struct OneParam(#[ethevent(indexed)] U256);
|
struct OneParam(#[ethevent(indexed)] U256);
|
||||||
|
|
||||||
let log = RawLog {
|
let log = RawLog {
|
||||||
|
@ -347,7 +347,7 @@ fn can_decode_event_tuple_single_param() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_decode_event_with_no_params() {
|
fn can_decode_event_with_no_params() {
|
||||||
#[derive(Debug, PartialEq, EthEvent)]
|
#[derive(Debug, PartialEq, Eq, EthEvent)]
|
||||||
pub struct NoParam {}
|
pub struct NoParam {}
|
||||||
|
|
||||||
let log = RawLog {
|
let log = RawLog {
|
||||||
|
@ -446,7 +446,7 @@ fn can_derive_ethcall() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_derive_ethcall_with_nested_structs() {
|
fn can_derive_ethcall_with_nested_structs() {
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType)]
|
||||||
struct SomeType {
|
struct SomeType {
|
||||||
inner: Address,
|
inner: Address,
|
||||||
msg: String,
|
msg: String,
|
||||||
|
@ -468,7 +468,7 @@ fn can_derive_ethcall_with_nested_structs() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_derive_for_enum() {
|
fn can_derive_for_enum() {
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType)]
|
||||||
enum ActionChoices {
|
enum ActionChoices {
|
||||||
GoLeft,
|
GoLeft,
|
||||||
GoRight,
|
GoRight,
|
||||||
|
@ -483,7 +483,7 @@ fn can_derive_for_enum() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_derive_abi_codec() {
|
fn can_derive_abi_codec() {
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType, EthAbiCodec)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType, EthAbiCodec)]
|
||||||
pub struct SomeType {
|
pub struct SomeType {
|
||||||
inner: Address,
|
inner: Address,
|
||||||
msg: String,
|
msg: String,
|
||||||
|
@ -498,7 +498,7 @@ fn can_derive_abi_codec() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_derive_abi_codec_single_field() {
|
fn can_derive_abi_codec_single_field() {
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType, EthAbiCodec)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType, EthAbiCodec)]
|
||||||
pub struct SomeType {
|
pub struct SomeType {
|
||||||
inner: Vec<U256>,
|
inner: Vec<U256>,
|
||||||
}
|
}
|
||||||
|
@ -530,7 +530,7 @@ fn can_derive_abi_codec_single_field() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_derive_abi_codec_two_field() {
|
fn can_derive_abi_codec_two_field() {
|
||||||
#[derive(Debug, Clone, PartialEq, EthAbiType, EthAbiCodec)]
|
#[derive(Debug, Clone, PartialEq, Eq, EthAbiType, EthAbiCodec)]
|
||||||
pub struct SomeType {
|
pub struct SomeType {
|
||||||
inner: Vec<U256>,
|
inner: Vec<U256>,
|
||||||
addr: Address,
|
addr: Address,
|
||||||
|
|
|
@ -10,7 +10,7 @@ macro_rules! unrecognised {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, PartialEq, Debug)]
|
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||||
pub enum Token<'input> {
|
pub enum Token<'input> {
|
||||||
Identifier(&'input str),
|
Identifier(&'input str),
|
||||||
Number(&'input str),
|
Number(&'input str),
|
||||||
|
@ -140,7 +140,7 @@ impl<'input> fmt::Display for Token<'input> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Clone, thiserror::Error)]
|
#[derive(Debug, PartialEq, Eq, Clone, thiserror::Error)]
|
||||||
pub enum LexerError {
|
pub enum LexerError {
|
||||||
#[error("UnrecognisedToken {0}:{1} `{2}`")]
|
#[error("UnrecognisedToken {0}:{1} `{2}`")]
|
||||||
UnrecognisedToken(usize, usize, String),
|
UnrecognisedToken(usize, usize, String),
|
||||||
|
|
|
@ -74,7 +74,7 @@ pub struct StructFieldDeclaration {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// How the type of a struct field is referenced
|
/// How the type of a struct field is referenced
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct StructType {
|
pub struct StructType {
|
||||||
/// The name of the struct (or rather the name of the rust type)
|
/// The name of the struct (or rather the name of the rust type)
|
||||||
name: String,
|
name: String,
|
||||||
|
|
|
@ -379,7 +379,7 @@ impl From<Block<Transaction>> for Block<TxHash> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
#[cfg(feature = "celo")]
|
#[cfg(feature = "celo")]
|
||||||
/// Commit-reveal data for generating randomness in the
|
/// Commit-reveal data for generating randomness in the
|
||||||
/// [Celo protocol](https://docs.celo.org/celo-codebase/protocol/identity/randomness)
|
/// [Celo protocol](https://docs.celo.org/celo-codebase/protocol/identity/randomness)
|
||||||
|
@ -390,7 +390,7 @@ pub struct Randomness {
|
||||||
pub revealed: Bytes,
|
pub revealed: Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
#[cfg(feature = "celo")]
|
#[cfg(feature = "celo")]
|
||||||
/// SNARK-friendly epoch block signature and bitmap
|
/// SNARK-friendly epoch block signature and bitmap
|
||||||
pub struct EpochSnarkData {
|
pub struct EpochSnarkData {
|
||||||
|
@ -400,7 +400,7 @@ pub struct EpochSnarkData {
|
||||||
pub signature: Bytes,
|
pub signature: Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||||
/// A Block Hash or Block Number
|
/// A Block Hash or Block Number
|
||||||
pub enum BlockId {
|
pub enum BlockId {
|
||||||
// TODO: May want to expand this to include the requireCanonical field
|
// TODO: May want to expand this to include the requireCanonical field
|
||||||
|
|
|
@ -9,7 +9,7 @@ use serde::{
|
||||||
use std::ops::{Range, RangeFrom, RangeTo};
|
use std::ops::{Range, RangeFrom, RangeTo};
|
||||||
|
|
||||||
/// A log produced by a transaction.
|
/// A log produced by a transaction.
|
||||||
#[derive(Debug, Clone, Default, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct Log {
|
pub struct Log {
|
||||||
/// H160. the contract that emitted the log
|
/// H160. the contract that emitted the log
|
||||||
pub address: Address,
|
pub address: Address,
|
||||||
|
@ -74,7 +74,7 @@ impl rlp::Encodable for Log {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum FilterBlockOption {
|
pub enum FilterBlockOption {
|
||||||
Range { from_block: Option<BlockNumber>, to_block: Option<BlockNumber> },
|
Range { from_block: Option<BlockNumber>, to_block: Option<BlockNumber> },
|
||||||
AtBlockHash(H256),
|
AtBlockHash(H256),
|
||||||
|
@ -157,7 +157,7 @@ impl FilterBlockOption {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Filter for
|
/// Filter for
|
||||||
#[derive(Default, Debug, PartialEq, Clone)]
|
#[derive(Default, Debug, PartialEq, Eq, Clone)]
|
||||||
pub struct Filter {
|
pub struct Filter {
|
||||||
/// Filter block options, specifying on which blocks the filter should
|
/// Filter block options, specifying on which blocks the filter should
|
||||||
/// match.
|
/// match.
|
||||||
|
@ -471,7 +471,7 @@ mod tests {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn can_serde_value_or_array() {
|
fn can_serde_value_or_array() {
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
|
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
|
||||||
struct Item {
|
struct Item {
|
||||||
value: ValueOrArray<U256>,
|
value: ValueOrArray<U256>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
use crate::types::{Address, Bytes, H256, U256};
|
use crate::types::{Address, Bytes, H256, U256};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
pub struct StorageProof {
|
pub struct StorageProof {
|
||||||
pub key: H256,
|
pub key: H256,
|
||||||
pub proof: Vec<Bytes>,
|
pub proof: Vec<Bytes>,
|
||||||
pub value: U256,
|
pub value: U256,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
pub struct EIP1186ProofResponse {
|
pub struct EIP1186ProofResponse {
|
||||||
address: Address,
|
address: Address,
|
||||||
|
|
|
@ -45,7 +45,7 @@ pub enum SignatureError {
|
||||||
/// The message data can either be a binary message that is first hashed
|
/// The message data can either be a binary message that is first hashed
|
||||||
/// according to EIP-191 and then recovered based on the signature or a
|
/// according to EIP-191 and then recovered based on the signature or a
|
||||||
/// precomputed hash.
|
/// precomputed hash.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub enum RecoveryMessage {
|
pub enum RecoveryMessage {
|
||||||
/// Message bytes
|
/// Message bytes
|
||||||
Data(Vec<u8>),
|
Data(Vec<u8>),
|
||||||
|
|
|
@ -3,7 +3,7 @@ use crate::types::{Address, BlockNumber, Bytes, H160, H256, U256};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// Trace filter
|
/// Trace filter
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Serialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize)]
|
||||||
#[serde(deny_unknown_fields)]
|
#[serde(deny_unknown_fields)]
|
||||||
pub struct TraceFilter {
|
pub struct TraceFilter {
|
||||||
/// From block
|
/// From block
|
||||||
|
@ -76,7 +76,7 @@ impl TraceFilter {
|
||||||
|
|
||||||
// `LocalizedTrace` in Parity
|
// `LocalizedTrace` in Parity
|
||||||
/// Trace-Filtering API trace type
|
/// Trace-Filtering API trace type
|
||||||
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
|
||||||
pub struct Trace {
|
pub struct Trace {
|
||||||
/// Action
|
/// Action
|
||||||
pub action: Action,
|
pub action: Action,
|
||||||
|
@ -107,7 +107,7 @@ pub struct Trace {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Response
|
/// Response
|
||||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
#[serde(untagged)]
|
#[serde(untagged)]
|
||||||
pub enum Res {
|
pub enum Res {
|
||||||
/// Call
|
/// Call
|
||||||
|
@ -125,7 +125,7 @@ impl Default for Res {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Action
|
/// Action
|
||||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
|
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
|
||||||
#[serde(untagged, rename_all = "lowercase")]
|
#[serde(untagged, rename_all = "lowercase")]
|
||||||
pub enum Action {
|
pub enum Action {
|
||||||
/// Call
|
/// Call
|
||||||
|
@ -139,7 +139,7 @@ pub enum Action {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An external action type.
|
/// An external action type.
|
||||||
#[derive(Debug, PartialEq, Clone, Serialize, Deserialize)]
|
#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)]
|
||||||
#[serde(rename_all = "lowercase")]
|
#[serde(rename_all = "lowercase")]
|
||||||
pub enum ActionType {
|
pub enum ActionType {
|
||||||
/// Contract call.
|
/// Contract call.
|
||||||
|
@ -153,7 +153,7 @@ pub enum ActionType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Call Result
|
/// Call Result
|
||||||
#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)]
|
||||||
pub struct CallResult {
|
pub struct CallResult {
|
||||||
/// Gas used
|
/// Gas used
|
||||||
#[serde(rename = "gasUsed")]
|
#[serde(rename = "gasUsed")]
|
||||||
|
@ -163,7 +163,7 @@ pub struct CallResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create Result
|
/// Create Result
|
||||||
#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)]
|
||||||
pub struct CreateResult {
|
pub struct CreateResult {
|
||||||
/// Gas used
|
/// Gas used
|
||||||
#[serde(rename = "gasUsed")]
|
#[serde(rename = "gasUsed")]
|
||||||
|
@ -175,7 +175,7 @@ pub struct CreateResult {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Call response
|
/// Call response
|
||||||
#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)]
|
||||||
pub struct Call {
|
pub struct Call {
|
||||||
/// Sender
|
/// Sender
|
||||||
pub from: Address,
|
pub from: Address,
|
||||||
|
@ -193,7 +193,7 @@ pub struct Call {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Call type.
|
/// Call type.
|
||||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
pub enum CallType {
|
pub enum CallType {
|
||||||
/// None
|
/// None
|
||||||
#[serde(rename = "none")]
|
#[serde(rename = "none")]
|
||||||
|
@ -219,7 +219,7 @@ impl Default for CallType {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Create response
|
/// Create response
|
||||||
#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)]
|
||||||
pub struct Create {
|
pub struct Create {
|
||||||
/// Sender
|
/// Sender
|
||||||
pub from: Address,
|
pub from: Address,
|
||||||
|
@ -232,7 +232,7 @@ pub struct Create {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Suicide
|
/// Suicide
|
||||||
#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)]
|
||||||
pub struct Suicide {
|
pub struct Suicide {
|
||||||
/// Address.
|
/// Address.
|
||||||
pub address: Address,
|
pub address: Address,
|
||||||
|
@ -244,7 +244,7 @@ pub struct Suicide {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reward action
|
/// Reward action
|
||||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
pub struct Reward {
|
pub struct Reward {
|
||||||
/// Author's address.
|
/// Author's address.
|
||||||
pub author: Address,
|
pub author: Address,
|
||||||
|
@ -256,7 +256,7 @@ pub struct Reward {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Reward type.
|
/// Reward type.
|
||||||
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
pub enum RewardType {
|
pub enum RewardType {
|
||||||
/// Block
|
/// Block
|
||||||
#[serde(rename = "block")]
|
#[serde(rename = "block")]
|
||||||
|
|
|
@ -86,7 +86,7 @@ pub struct StateDiff(pub BTreeMap<H160, AccountDiff>);
|
||||||
|
|
||||||
// ------------------ Trace -------------
|
// ------------------ Trace -------------
|
||||||
/// Trace
|
/// Trace
|
||||||
#[derive(Debug, PartialEq, Clone, Deserialize, Serialize)]
|
#[derive(Debug, PartialEq, Eq, Clone, Deserialize, Serialize)]
|
||||||
pub struct TransactionTrace {
|
pub struct TransactionTrace {
|
||||||
/// Trace address
|
/// Trace address
|
||||||
#[serde(rename = "traceAddress")]
|
#[serde(rename = "traceAddress")]
|
||||||
|
@ -130,7 +130,7 @@ pub struct VMOperation {
|
||||||
pub sub: Option<VMTrace>,
|
pub sub: Option<VMTrace>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)]
|
||||||
#[allow(clippy::upper_case_acronyms)]
|
#[allow(clippy::upper_case_acronyms)]
|
||||||
/// A record of an executed VM operation.
|
/// A record of an executed VM operation.
|
||||||
pub struct VMExecutedOperation {
|
pub struct VMExecutedOperation {
|
||||||
|
@ -147,7 +147,7 @@ pub struct VMExecutedOperation {
|
||||||
pub store: Option<StorageDiff>,
|
pub store: Option<StorageDiff>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)]
|
||||||
#[allow(clippy::upper_case_acronyms)]
|
#[allow(clippy::upper_case_acronyms)]
|
||||||
/// A diff of some chunk of memory.
|
/// A diff of some chunk of memory.
|
||||||
pub struct MemoryDiff {
|
pub struct MemoryDiff {
|
||||||
|
@ -157,7 +157,7 @@ pub struct MemoryDiff {
|
||||||
pub data: Bytes,
|
pub data: Bytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Default, Deserialize, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Default, Deserialize, Serialize)]
|
||||||
#[allow(clippy::upper_case_acronyms)]
|
#[allow(clippy::upper_case_acronyms)]
|
||||||
/// A diff of some storage value.
|
/// A diff of some storage value.
|
||||||
pub struct StorageDiff {
|
pub struct StorageDiff {
|
||||||
|
|
|
@ -24,7 +24,7 @@ use thiserror::Error;
|
||||||
/// the `legacy` crate feature. This will disable the `type` flag in the
|
/// the `legacy` crate feature. This will disable the `type` flag in the
|
||||||
/// serialized transaction, and cause contract calls and other common actions
|
/// serialized transaction, and cause contract calls and other common actions
|
||||||
/// to default to using the legacy transaction type.
|
/// to default to using the legacy transaction type.
|
||||||
#[derive(Serialize, Deserialize, Clone, PartialEq, Debug)]
|
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, Debug)]
|
||||||
#[cfg_attr(not(feature = "legacy"), serde(tag = "type"))]
|
#[cfg_attr(not(feature = "legacy"), serde(tag = "type"))]
|
||||||
#[cfg_attr(feature = "legacy", serde(untagged))]
|
#[cfg_attr(feature = "legacy", serde(untagged))]
|
||||||
pub enum TypedTransaction {
|
pub enum TypedTransaction {
|
||||||
|
@ -742,7 +742,7 @@ mod tests {
|
||||||
let tx = TypedTransaction::decode(&tx_rlp).unwrap();
|
let tx = TypedTransaction::decode(&tx_rlp).unwrap();
|
||||||
|
|
||||||
{
|
{
|
||||||
let typed_tx: TypedTransaction = tx.clone().into();
|
let typed_tx: TypedTransaction = tx.clone();
|
||||||
|
|
||||||
let tx0: TransactionRequest = typed_tx.clone().into();
|
let tx0: TransactionRequest = typed_tx.clone().into();
|
||||||
assert!(typed_tx.as_legacy_ref().is_none());
|
assert!(typed_tx.as_legacy_ref().is_none());
|
||||||
|
@ -752,7 +752,7 @@ mod tests {
|
||||||
assert_eq!(tx0, tx1);
|
assert_eq!(tx0, tx1);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
let typed_tx: TypedTransaction = tx.clone().into();
|
let typed_tx: TypedTransaction = tx.clone();
|
||||||
let tx0: Eip1559TransactionRequest = typed_tx.clone().into();
|
let tx0: Eip1559TransactionRequest = typed_tx.clone().into();
|
||||||
assert_eq!(tx.as_eip1559_ref().unwrap(), &tx0);
|
assert_eq!(tx.as_eip1559_ref().unwrap(), &tx0);
|
||||||
|
|
||||||
|
@ -761,7 +761,7 @@ mod tests {
|
||||||
assert_eq!(tx0, tx1);
|
assert_eq!(tx0, tx1);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
let typed_tx: TypedTransaction = tx.clone().into();
|
let typed_tx: TypedTransaction = tx;
|
||||||
let tx0: Eip2930TransactionRequest = typed_tx.clone().into();
|
let tx0: Eip2930TransactionRequest = typed_tx.clone().into();
|
||||||
assert!(typed_tx.as_eip2930_ref().is_none());
|
assert!(typed_tx.as_eip2930_ref().is_none());
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ pub enum Eip2930RequestError {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An EIP-2930 transaction is a legacy transaction including an [`AccessList`].
|
/// An EIP-2930 transaction is a legacy transaction including an [`AccessList`].
|
||||||
#[derive(Clone, Serialize, Deserialize, PartialEq, Debug)]
|
#[derive(Clone, Serialize, Deserialize, PartialEq, Eq, Debug)]
|
||||||
pub struct Eip2930TransactionRequest {
|
pub struct Eip2930TransactionRequest {
|
||||||
#[serde(flatten)]
|
#[serde(flatten)]
|
||||||
pub tx: TransactionRequest,
|
pub tx: TransactionRequest,
|
||||||
|
|
|
@ -11,7 +11,7 @@ use rlp::{Decodable, DecoderError, RlpStream};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
/// Details of a signed transaction
|
/// Details of a signed transaction
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, Default)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default)]
|
||||||
pub struct Transaction {
|
pub struct Transaction {
|
||||||
/// The transaction's hash
|
/// The transaction's hash
|
||||||
pub hash: H256,
|
pub hash: H256,
|
||||||
|
@ -370,7 +370,7 @@ impl Decodable for Transaction {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// "Receipt" of an executed transaction: details of its execution.
|
/// "Receipt" of an executed transaction: details of its execution.
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct TransactionReceipt {
|
pub struct TransactionReceipt {
|
||||||
/// Transaction hash.
|
/// Transaction hash.
|
||||||
#[serde(rename = "transactionHash")]
|
#[serde(rename = "transactionHash")]
|
||||||
|
|
|
@ -7,7 +7,7 @@ use serde::{
|
||||||
use std::{collections::BTreeMap, fmt, str::FromStr};
|
use std::{collections::BTreeMap, fmt, str::FromStr};
|
||||||
|
|
||||||
/// Transaction summary as found in the Txpool Inspection property.
|
/// Transaction summary as found in the Txpool Inspection property.
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Serialize)]
|
||||||
pub struct TxpoolInspectSummary {
|
pub struct TxpoolInspectSummary {
|
||||||
/// Recipient (None when contract creation)
|
/// Recipient (None when contract creation)
|
||||||
pub to: Option<Address>,
|
pub to: Option<Address>,
|
||||||
|
@ -90,7 +90,7 @@ impl<'de> Deserialize<'de> for TxpoolInspectSummary {
|
||||||
/// as the ones that are being scheduled for future execution only.
|
/// as the ones that are being scheduled for future execution only.
|
||||||
///
|
///
|
||||||
/// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_content) for more details
|
/// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_content) for more details
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
pub struct TxpoolContent {
|
pub struct TxpoolContent {
|
||||||
/// pending tx
|
/// pending tx
|
||||||
pub pending: BTreeMap<Address, BTreeMap<String, TxpoolTransaction>>,
|
pub pending: BTreeMap<Address, BTreeMap<String, TxpoolTransaction>>,
|
||||||
|
@ -107,7 +107,7 @@ pub struct TxpoolContent {
|
||||||
/// transactions in the pool and find any potential issues.
|
/// transactions in the pool and find any potential issues.
|
||||||
///
|
///
|
||||||
/// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_inspect) for more details
|
/// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_inspect) for more details
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct TxpoolInspect {
|
pub struct TxpoolInspect {
|
||||||
/// pending tx
|
/// pending tx
|
||||||
pub pending: BTreeMap<Address, BTreeMap<String, TxpoolInspectSummary>>,
|
pub pending: BTreeMap<Address, BTreeMap<String, TxpoolInspectSummary>>,
|
||||||
|
@ -122,7 +122,7 @@ pub struct TxpoolInspect {
|
||||||
/// are being scheduled for future execution only.
|
/// are being scheduled for future execution only.
|
||||||
///
|
///
|
||||||
/// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_status) for more details
|
/// See [here](https://geth.ethereum.org/docs/rpc/ns-txpool#txpool_status) for more details
|
||||||
#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)]
|
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize, Serialize)]
|
||||||
pub struct TxpoolStatus {
|
pub struct TxpoolStatus {
|
||||||
/// number of pending tx
|
/// number of pending tx
|
||||||
pub pending: U64,
|
pub pending: U64,
|
||||||
|
|
|
@ -54,7 +54,7 @@ impl FromStr for ERCNFT {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Supported ERCs
|
/// Supported ERCs
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq, Eq)]
|
||||||
pub enum ERCNFTType {
|
pub enum ERCNFTType {
|
||||||
ERC721,
|
ERC721,
|
||||||
ERC1155,
|
ERC1155,
|
||||||
|
|
|
@ -16,7 +16,7 @@ use thiserror::Error;
|
||||||
const DEFAULT_DERIVATION_PATH_PREFIX: &str = "m/44'/60'/0'/0/";
|
const DEFAULT_DERIVATION_PATH_PREFIX: &str = "m/44'/60'/0'/0/";
|
||||||
|
|
||||||
/// Represents a structure that can resolve into a `Wallet<SigningKey>`.
|
/// Represents a structure that can resolve into a `Wallet<SigningKey>`.
|
||||||
#[derive(Clone, Debug, PartialEq)]
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
||||||
pub struct MnemonicBuilder<W: Wordlist> {
|
pub struct MnemonicBuilder<W: Wordlist> {
|
||||||
/// The mnemonic phrase can be supplied to the builder as a string or a path to the file whose
|
/// The mnemonic phrase can be supplied to the builder as a string or a path to the file whose
|
||||||
/// contents are the phrase. A builder that has a valid phrase should `build` the wallet.
|
/// contents are the phrase. A builder that has a valid phrase should `build` the wallet.
|
||||||
|
|
|
@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};
|
||||||
use std::{collections::BTreeMap, path::Path};
|
use std::{collections::BTreeMap, path::Path};
|
||||||
|
|
||||||
/// (source_file path -> `SourceFile` + solc version)
|
/// (source_file path -> `SourceFile` + solc version)
|
||||||
#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Eq, Default, Serialize, Deserialize)]
|
||||||
#[serde(transparent)]
|
#[serde(transparent)]
|
||||||
pub struct VersionedSourceFiles(pub BTreeMap<String, Vec<VersionedSourceFile>>);
|
pub struct VersionedSourceFiles(pub BTreeMap<String, Vec<VersionedSourceFile>>);
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ impl IntoIterator for VersionedSourceFiles {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A [SourceFile] and the compiler version used to compile it
|
/// A [SourceFile] and the compiler version used to compile it
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||||
pub struct VersionedSourceFile {
|
pub struct VersionedSourceFile {
|
||||||
pub source_file: SourceFile,
|
pub source_file: SourceFile,
|
||||||
pub version: Version,
|
pub version: Version,
|
||||||
|
|
|
@ -57,7 +57,7 @@ impl Remapping {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(thiserror::Error, Debug, PartialEq, PartialOrd)]
|
#[derive(thiserror::Error, Debug, PartialEq, Eq, PartialOrd)]
|
||||||
pub enum RemappingError {
|
pub enum RemappingError {
|
||||||
#[error("no prefix found")]
|
#[error("no prefix found")]
|
||||||
NoPrefix,
|
NoPrefix,
|
||||||
|
|
|
@ -144,7 +144,7 @@ pub struct SolImport {
|
||||||
aliases: Vec<SolImportAlias>,
|
aliases: Vec<SolImportAlias>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub enum SolImportAlias {
|
pub enum SolImportAlias {
|
||||||
File(String),
|
File(String),
|
||||||
Contract(String, String),
|
Contract(String, String),
|
||||||
|
|
|
@ -22,7 +22,7 @@ impl SyntaxError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq, Eq)]
|
||||||
enum Token<'a> {
|
enum Token<'a> {
|
||||||
Number(&'a str),
|
Number(&'a str),
|
||||||
Semicolon,
|
Semicolon,
|
||||||
|
|
Loading…
Reference in New Issue