aboutsummaryrefslogtreecommitdiff
path: root/src/transaction/eip1559.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/transaction/eip1559.rs')
-rw-r--r--src/transaction/eip1559.rs13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/transaction/eip1559.rs b/src/transaction/eip1559.rs
index d8fa713..c6acf8b 100644
--- a/src/transaction/eip1559.rs
+++ b/src/transaction/eip1559.rs
@@ -27,9 +27,8 @@ pub struct Eip1559Transaction {
#[serde(with = "serialization::u256")]
pub max_fee_per_gas: U256,
/// The gas limit for the transaction.
- #[serde(rename = "gasLimit")]
#[serde(with = "serialization::u256")]
- pub gas_limit: U256,
+ pub gas: U256,
/// The target address for the transaction. This can also be `None` to
/// indicate a contract creation transaction.
pub to: Option<Address>,
@@ -53,7 +52,7 @@ impl Eip1559Transaction {
rlp::uint(self.nonce),
rlp::uint(self.max_priority_fee_per_gas),
rlp::uint(self.max_fee_per_gas),
- rlp::uint(self.gas_limit),
+ rlp::uint(self.gas),
self.to
.map_or_else(|| rlp::bytes(b""), |to| rlp::bytes(&*to)),
rlp::uint(self.value),
@@ -91,7 +90,7 @@ mod tests {
"nonce": 42,
"maxPriorityFeePerGas": 13.37e9,
"maxFeePerGas": 42e9,
- "gasLimit": 21000,
+ "gas": 21000,
"value": "13370000000000000000",
"data": "0x",
});
@@ -102,7 +101,7 @@ mod tests {
nonce: 42.as_u256(),
max_priority_fee_per_gas: 13.37e9.as_u256(),
max_fee_per_gas: 42e9.as_u256(),
- gas_limit: 21_000.as_u256(),
+ gas: 21_000.as_u256(),
to: None,
value: 13.37e18.as_u256(),
data: vec![],
@@ -134,7 +133,7 @@ mod tests {
nonce: 66.as_u256(),
max_priority_fee_per_gas: 28e9.as_u256(),
max_fee_per_gas: 42e9.as_u256(),
- gas_limit: 30_000.as_u256(),
+ gas: 30_000.as_u256(),
to: Some(Address(hex!("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"))),
value: 13.37e18.as_u256(),
data: vec![],
@@ -153,7 +152,7 @@ mod tests {
nonce: 777.as_u256(),
max_priority_fee_per_gas: 28e9.as_u256(),
max_fee_per_gas: 42e9.as_u256(),
- gas_limit: 100_000.as_u256(),
+ gas: 100_000.as_u256(),
to: None,
value: 0.as_u256(),
data: hex!(