Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions client/rpc-core/src/types/call_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub struct CallRequest {
/// Value
pub value: Option<U256>,
/// Data
#[serde(alias = "input")]
pub data: Option<Bytes>,
/// Nonce
pub nonce: Option<U256>,
Expand Down
1 change: 1 addition & 0 deletions client/rpc-core/src/types/transaction_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub struct TransactionRequest {
/// Value of transaction in wei
pub value: Option<U256>,
/// Additional data sent with transaction
#[serde(alias = "input")]
pub data: Option<Bytes>,
/// Transaction's nonce
pub nonce: Option<U256>,
Expand Down
2 changes: 1 addition & 1 deletion ts-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"truffle": "^5.7.0",
"ts-node": "^8.10.2",
"typescript": "^3.9.6",
"web3": "^1.8.0"
"web3": "^1.9.0"
},
"devDependencies": {
"@types/chai-as-promised": "^7.1.5",
Expand Down
12 changes: 12 additions & 0 deletions ts-tests/tests/test-execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,16 @@ describeWithFrontier("Frontier RPC (RPC execution)", (context) => {
id: 1,
});
});

step("`input` field alias is properly deserialized", async function () {
const result = await customRequest(context.web3, "eth_call", [
{
from: GENESIS_ACCOUNT,
gas: `0x${(ETH_BLOCK_GAS_LIMIT - 1).toString(16)}`,
input: TEST_CONTRACT_BYTECODE,
},
]);

expect(result.result).to.be.equal(TEST_CONTRACT_DEPLOYED_BYTECODE);
});
});