-
Notifications
You must be signed in to change notification settings - Fork 198
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
Conversation
iulianpascalau
commented
Oct 9, 2020
- fixed the tx simulation process
- added unit tests for tx simulation rest api endpoint
- added unit tests for tx simulation rest api endpoint
api/transaction/routes_test.go
Outdated
@@ -555,6 +561,216 @@ func TestComputeTransactionGasLimit(t *testing.T) { | |||
assert.Equal(t, expectedGasLimit, txCostResp.Data.Cost) | |||
} | |||
|
|||
func TestSimulateTransaction_BasRequestShouldErr(t *testing.T) { |
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.
Bad*
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
facade/interface.go
Outdated
@@ -34,6 +34,7 @@ type NodeHandler interface { | |||
|
|||
//ValidateTransaction will validate a transaction | |||
ValidateTransaction(tx *transaction.Transaction) error | |||
ValidateTransactionForTxSimulation(tx *transaction.Transaction) error |
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.
maybe rename to ValidateSimulatedTransaction
? or ValidateTransactionForSimulation
?
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
node/node.go
Outdated
@@ -823,6 +823,31 @@ func (n *Node) ValidateTransaction(tx *transaction.Transaction) error { | |||
return err | |||
} | |||
|
|||
txValidator, intTx, err := n.txCommonValidation(tx) |
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.
could use full words, no abbreviations.
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
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.
👍