-
Notifications
You must be signed in to change notification settings - Fork 411
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
Implement tx counter for transaction info #621
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.
Nice clean version.
👍
app/ante.go
Outdated
ante.NewSigGasConsumeDecorator(ak, sigGasConsumer), | ||
ante.NewSigVerificationDecorator(ak, signModeHandler), | ||
ante.NewIncrementSequenceDecorator(ak), | ||
wasmkeeper.NewCountTXDecorator(txCounterStoreKey), |
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.
We should add some note that chains using x/wasm need to add this custom AnteHandler if they want Tx Index info.
Not sure where that goes? Integration.md?
Please make sure to tick the box in #618 after merging |
Codecov Report
@@ Coverage Diff @@
## master #621 +/- ##
==========================================
+ Coverage 60.04% 60.39% +0.34%
==========================================
Files 45 48 +3
Lines 5209 5254 +45
==========================================
+ Hits 3128 3173 +45
Misses 1859 1859
Partials 222 222
|
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
@@ -63,6 +63,10 @@ from the Cosmos SDK, and enabled them in `app.go`. If so, you can just look | |||
at [`wasmd/app/app.go`](https://github.com/CosmWasm/wasmd/blob/master/app/app.go#) | |||
for how to do so (just search there for lines with `wasm`). | |||
|
|||
`wasmd` also comes with a custom `ante handler` that adds the TX position in the block into the context |
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
@@ -8,7 +8,7 @@ echo "## Add new CosmWasm contract" | |||
RESP=$(wasmd tx wasm store "$DIR/../../x/wasm/keeper/testdata/hackatom.wasm" \ | |||
--from validator --gas 1500000 -y --chain-id=testing --node=http://localhost:26657 -b block) | |||
|
|||
CODE_ID=$(echo "$RESP" | jq -r '.logs[0].events[0].attributes[-1].value') | |||
CODE_ID=$(echo "$RESP" | jq -r '.logs[0].events[1].attributes[-1].value') |
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.
The ante handler added an event?
Or this is just an older bug you just found?
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.
This was a 🐛 that I found with manual tests. Not related to the ante handler.
Resolves #601
Based on the #608 spike
Changes:
uint32
for the tx counter0
counter but empty TransactionInfo on simulations