Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Blocked] Update TransactionRequest's to field to TxKind #553

Merged
merged 20 commits into from
Apr 23, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: with_call impl.
  • Loading branch information
EmperorOrokuSaki committed Apr 17, 2024
commit fc8b67fcdf671ff381c80b13fc37bba91413460f
13 changes: 11 additions & 2 deletions crates/rpc-types/src/eth/transaction/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,18 @@ impl TransactionRequest {
}
}

fn with_call<T: SolCall>(self, t: T) -> Self {
fn with_call<T: SolCall>(mut self, t: &T) -> Self {

if matches!(self.to, Some(TxKind::Create)) {
self.to = None;
}

let data: Vec<u8> = t.abi_encode();
Self {
// wip
input: TransactionInput {
input: Some(Bytes::from(data)),
data: Some(Bytes::from(data)),
},
..self
}
}
Expand Down