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

EVM: add input to eth_sendTransaction #2069

Merged
merged 5 commits into from
Jun 16, 2023
Merged
Changes from all commits
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
20 changes: 17 additions & 3 deletions lib/ain-grpc/src/transaction_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ pub struct TransactionRequest {
pub value: Option<U256>,
/// Additional data sent with transaction
pub data: Option<Bytes>,
/// Input
pub input: Option<Bytes>,
/// Transaction's nonce
pub nonce: Option<U256>,
/// Pre-pay to warm storage access.
Expand All @@ -54,7 +56,11 @@ impl From<TransactionRequest> for Option<TransactionMessage> {
gas_price: req.gas_price.unwrap_or_default(),
gas_limit: req.gas.unwrap_or_default(),
value: req.value.unwrap_or_default(),
input: req.data.map(Bytes::into_vec).unwrap_or_default(),
input: req
.input
.or_else(|| req.data)
.map(Bytes::into_vec)
.unwrap_or_default(),
action: match req.to {
Some(to) => ethereum::TransactionAction::Call(to),
None => ethereum::TransactionAction::Create,
Expand All @@ -67,7 +73,11 @@ impl From<TransactionRequest> for Option<TransactionMessage> {
gas_price: req.gas_price.unwrap_or_default(),
gas_limit: req.gas.unwrap_or_default(),
value: req.value.unwrap_or_default(),
input: req.data.map(Bytes::into_vec).unwrap_or_default(),
input: req
.input
.or_else(|| req.data)
.map(Bytes::into_vec)
.unwrap_or_default(),
action: match req.to {
Some(to) => ethereum::TransactionAction::Call(to),
None => ethereum::TransactionAction::Create,
Expand All @@ -84,7 +94,11 @@ impl From<TransactionRequest> for Option<TransactionMessage> {
max_priority_fee_per_gas: req.max_priority_fee_per_gas.unwrap_or_default(),
gas_limit: req.gas.unwrap_or_default(),
value: req.value.unwrap_or_default(),
input: req.data.map(Bytes::into_vec).unwrap_or_default(),
input: req
.input
.or_else(|| req.data)
.map(Bytes::into_vec)
.unwrap_or_default(),
action: match req.to {
Some(to) => ethereum::TransactionAction::Call(to),
None => ethereum::TransactionAction::Create,
Expand Down