-
Notifications
You must be signed in to change notification settings - Fork 266
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
Add input to CallArguments class #2075
Conversation
@@ -39,6 +39,7 @@ public class Constants { | |||
public static final byte TESTNET_CHAIN_ID = (byte) 31; | |||
public static final byte DEVNET_CHAIN_ID = (byte) 32; | |||
public static final byte REGTEST_CHAIN_ID = (byte) 33; | |||
public static final String TEST_DATA = "0x603d80600c6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463c6888fa18114602d57005b6007600435028060005260206000f3"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like this is tests specific field and only used in EthModuleTest
. I'd rather move it to tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, I moved it to the test file.
@@ -36,6 +38,7 @@ public class CallArguments { | |||
private String nonce; | |||
private String chainId; | |||
private String type; // ignore, see https://github.com/rsksmart/rskj/pull/1601 | |||
private String input; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really need this extra field? Can we reuse data
and have something like this?:
public void setInput(String input) {
this.data = input;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I've removed it and implemented your suggested approach.
@@ -353,4 +355,359 @@ void chainId() { | |||
); | |||
assertThat(eth.chainId(), is("0x21")); | |||
} | |||
|
|||
@Test | |||
void whenExecuteCallWithDataParameter_callExecutorWithData() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice coverage 👍 could we also test CallArguments
as an unit? Eg as in here? - web3_CallArguments_toString()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Kudos, SonarCloud Quality Gate passed! |
0bc1fc5
to
cbe551f
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs 100.0% Coverage The version of Java (11.0.16) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17. |
Description
input
field to CallArgumentsMotivation and Context
Following the investigation done in CORE-2939, regarding an issue with some of the RPC methods we use in rskj, we found that both Web3js and Geth now have a parameter called
input
which currently is not supported by our code, this parameter seems to behave similar to thedata
parameter given that Web3js automatically addinput
in the payload if it is missing add sets its value to a copy fromdata
's.How Has This Been Tested?
Types of changes
Checklist: