Skip to content

Handling data and input fields in TransactionRequest and CallRequest#1096

Merged
sorpaas merged 11 commits intopolkadot-evm:masterfrom
moonbeam-foundation:ahmad-fix-data-field-duplicated
Jul 18, 2023
Merged

Handling data and input fields in TransactionRequest and CallRequest#1096
sorpaas merged 11 commits intopolkadot-evm:masterfrom
moonbeam-foundation:ahmad-fix-data-field-duplicated

Conversation

@ahmadkaouk
Copy link
Copy Markdown
Contributor

This PR refines the handling of data and input fields in TransactionRequest and CallRequest. Previously, provision of both fields resulted in errors.

Key updates in this PR:

  1. Identical data and input fields no longer throw errors.
  2. If data and input fields differ, an error is returned to prevent ambiguity.
  3. If only input is provided, its value is used for data.

@ahmadkaouk ahmadkaouk requested a review from sorpaas as a code owner July 4, 2023 13:48
@cla-bot-2021
Copy link
Copy Markdown

cla-bot-2021 bot commented Jul 4, 2023

User @ahmadkaouk, please sign the CLA here.

Comment on lines +21 to 25
use crate::types::{deserialize_data_or_input, Bytes};
use ethereum::AccessListItem;
use ethereum_types::{H160, H256, U256};
use serde::Deserialize;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
use crate::types::{deserialize_data_or_input, Bytes};
use ethereum::AccessListItem;
use ethereum_types::{H160, H256, U256};
use serde::Deserialize;
use ethereum::AccessListItem;
use ethereum_types::{H160, H256, U256};
use serde::Deserialize;
use crate::types::{deserialize_data_or_input, Bytes};

Copy link
Copy Markdown
Member

@sorpaas sorpaas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our project starts to smell Microsoft Windows..

@sorpaas sorpaas merged commit bd5bd37 into polkadot-evm:master Jul 18, 2023
noandrea pushed a commit to moonbeam-foundation/frontier that referenced this pull request Aug 28, 2023
…equest` (polkadot-evm#1096)

* Update deserializing data and input fields in TransactionRequest

* Custom deserializing for data and input in CallRequest

* Manually implement Deserialize for TransactionRequest and CallRequest

* Add some unit test for the custom deserialization

* add functional tests

* fix formatting

* deserializer for aliased fields

* custom deserializer for data and input fields in TransactionRequest

* fix formatting

* update functional test

* refactor code and fix formatting

---------

Co-authored-by: tgmichel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants