Skip to content

Commit

Permalink
fix failing test: properly handle 1-arg methods
Browse files Browse the repository at this point in the history
  • Loading branch information
feuGeneA committed Jun 5, 2023
1 parent 7832956 commit 7a4c143
Showing 1 changed file with 50 additions and 10 deletions.
60 changes: 50 additions & 10 deletions crates/rethnet_eth/src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,31 @@ enum MethodInvocation {
/// include transaction data
bool,
),
#[serde(rename = "eth_getBlockTransactionCountByHash")]
#[serde(
rename = "eth_getBlockTransactionCountByHash",
serialize_with = "single_to_sequence",
deserialize_with = "sequence_to_single"
)]
GetBlockTransactionCountByHash(B256),
#[serde(rename = "eth_getBlockTransactionCountByNumber")]
#[serde(
rename = "eth_getBlockTransactionCountByNumber",
serialize_with = "single_to_sequence",
deserialize_with = "sequence_to_single"
)]
GetBlockTransactionCountByNumber(BlockSpec),
#[serde(rename = "eth_getCode")]
GetCode(Address, BlockSpec),
#[serde(rename = "eth_getFilterChanges")]
#[serde(
rename = "eth_getFilterChanges",
serialize_with = "single_to_sequence",
deserialize_with = "sequence_to_single"
)]
GetFilterChanges(U256),
#[serde(rename = "eth_getFilterLogs")]
#[serde(
rename = "eth_getFilterLogs",
serialize_with = "single_to_sequence",
deserialize_with = "sequence_to_single"
)]
GetFilterLogs(U256),
#[serde(
rename = "eth_getLogs",
Expand Down Expand Up @@ -271,27 +287,51 @@ enum MethodInvocation {
Mining(),
#[serde(rename = "eth_newBlockFilter")]
NewBlockFilter(),
#[serde(rename = "eth_newFilter")]
#[serde(
rename = "eth_newFilter",
serialize_with = "single_to_sequence",
deserialize_with = "sequence_to_single"
)]
NewFilter(FilterOptions),
#[serde(rename = "eth_newPendingTransactionFilter")]
NewPendingTransactionFilter(),
#[serde(rename = "eth_pendingTransactions")]
PendingTransactions(),
#[serde(rename = "eth_sendRawTransaction")]
#[serde(
rename = "eth_sendRawTransaction",
serialize_with = "single_to_sequence",
deserialize_with = "sequence_to_single"
)]
SendRawTransaction(ZeroXPrefixedBytes),
#[serde(rename = "eth_sendTransaction")]
#[serde(
rename = "eth_sendTransaction",
serialize_with = "single_to_sequence",
deserialize_with = "sequence_to_single"
)]
SendTransaction(TransactionInput),
#[serde(rename = "eth_sign")]
Sign(Address, ZeroXPrefixedBytes),
#[serde(rename = "eth_signTypedData_v4")]
SignTypedDataV4(Address, eth::eip712::Message),
#[serde(rename = "eth_subscribe")]
#[serde(
rename = "eth_subscribe",
serialize_with = "single_to_sequence",
deserialize_with = "sequence_to_single"
)]
Subscribe(Vec<String>),
#[serde(rename = "eth_syncing")]
Syncing(),
#[serde(rename = "eth_uninstallFilter")]
#[serde(
rename = "eth_uninstallFilter",
serialize_with = "single_to_sequence",
deserialize_with = "sequence_to_single"
)]
UninstallFilter(U256),
#[serde(rename = "eth_unsubscribe")]
#[serde(
rename = "eth_unsubscribe",
serialize_with = "single_to_sequence",
deserialize_with = "sequence_to_single"
)]
Unsubscribe(Vec<ZeroXPrefixedBytes>),
}

Expand Down

0 comments on commit 7a4c143

Please sign in to comment.