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

EN 7890 fix cannot simulate tx #2361

Merged
merged 3 commits into from
Oct 12, 2020
Merged

Conversation

iulianpascalau
Copy link
Contributor

  • fixed the tx simulation process
  • added unit tests for tx simulation rest api endpoint

@sasurobert sasurobert self-requested a review October 12, 2020 09:10
sasurobert
sasurobert previously approved these changes Oct 12, 2020
@@ -555,6 +561,216 @@ func TestComputeTransactionGasLimit(t *testing.T) {
assert.Equal(t, expectedGasLimit, txCostResp.Data.Cost)
}

func TestSimulateTransaction_BasRequestShouldErr(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Bad*

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -34,6 +34,7 @@ type NodeHandler interface {

//ValidateTransaction will validate a transaction
ValidateTransaction(tx *transaction.Transaction) error
ValidateTransactionForTxSimulation(tx *transaction.Transaction) error
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe rename to ValidateSimulatedTransaction? or ValidateTransactionForSimulation ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

node/node.go Outdated
@@ -823,6 +823,31 @@ func (n *Node) ValidateTransaction(tx *transaction.Transaction) error {
return err
}

txValidator, intTx, err := n.txCommonValidation(tx)
Copy link
Contributor

Choose a reason for hiding this comment

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

could use full words, no abbreviations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

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

👍

@LucianMincu LucianMincu merged commit 136354e into development Oct 12, 2020
@LucianMincu LucianMincu deleted the EN-7890-fix-cannot-simulate-tx branch October 12, 2020 12:46
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.

None yet

4 participants