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

Handling data and input fields in TransactionRequest and CallRequest #1096

Merged

Conversation

ahmadkaouk
Copy link
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

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
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
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 <telmo@moonsonglabs.com>
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