-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix issues in simulate
RPC
#5265
Conversation
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.
LGTM
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #5265 +/- ##
=======================================
Coverage 78.1% 78.1%
=======================================
Files 790 790
Lines 67607 67619 +12
Branches 8164 8163 -1
=======================================
+ Hits 52828 52842 +14
+ Misses 14779 14777 -2
|
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.
Looks good
Adding another fix to this PR |
88a7b0e
to
d3ca561
Compare
Added a new nontrivial commit
simulate
RPCsimulate
RPC
Tentative commit message:
|
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.
Can you pls add an item into API-CHANGELOG.md
with the new behaviour of sign-and-submit
?
@@ -467,6 +467,13 @@ transactionPreProcessImpl( | |||
|
|||
if (!tx_json.isMember(jss::Flags)) | |||
tx_json[jss::Flags] = tfFullyCanonicalSig; | |||
|
|||
if (!tx_json.isMember(jss::NetworkID)) |
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.
Please move if (signingArgs.editFields())
block into separate "Autofill" function. transactionPreProcessImpl
is already too big and better to split it
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.
I have even better idea - the same "Autofill" function must be the used across "submit" and "simulate" (to produce even more consistent results).
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.
I think that's out of scope of this particular PR - but yes, would like to do that as a future refactor.
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.
Expanding already big function is a bad change, so I better insist on moving out autofill
block. Reusing "autofill" with the "simulate" is up to you, I can't assess the complexity of this change now.
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.
Refactoring will expand this PR from just a couple of lines changing here to being much larger, which will also require more testing etc.
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.
ok
Ok from Clio team |
High Level Overview of Change
This PR prevents the use of
seed
,secret
,seed_hex
, andpassphrase
fields in thesimulate
RPC, and adds autofilling forNetworkID
s in simulated transactions.Context of Change
The former is to avoid confusion with RPCs like
sign
andsimulate
. Transactions provided in thesimulate
RPC are supposed to be unsigned, so users should also not submit any secrets alongside those transactions.The latter is to make it easier to work with networks with a larger network ID.
Type of Change
API Impact
Test Plan
Tests added.