-
Notifications
You must be signed in to change notification settings - Fork 289
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
Fail to decode raw Pay For Data Tx #1265
Comments
cc @rootulp Any quick suggestions? |
@xiaying-peng apologies for not documenting this well enough, this is something that we are working on in #1257. The transactions that contain
so encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...)
for _, rawTx := range b.Data.Txs {
sdkTx, err := encoding.IndexWrapperDecoder(encCfg.TxConfig.TxDecoder())(rawTx) |
also kinda related to #485 |
Hi @evan-forbes , I tried the same code, but still same error:
|
The reason I want to decode the tx because I want to get
This is a little bit different than other Cosmos based chains, since other Chain's events does not contain Fee debit and credit. |
mocha is using v0.11.1, so we can't actually use the version listed in the issue. That is likely the case, but I'll check myself in a second |
Yeah, using v0.11.1, this test works as expected func TestExample(t *testing.T) {
txs := []string{
"CiBsaebmNmMGH/oqyFSQKZE31Qa8+cuzpP3+jxDuGPPS3hKqAgp8CnoKFi9wYXltZW50Lk1zZ1BheUZvckRhdGESYAovY2VsZXN0aWExcmE3dTN1NjI0NXQ2Mzl1ejUzc3RodWZya3J2dDlyMnlqbW5qY3cSCG9dtlaZ+E6HGJQDIiBjeUD36dUpKiBzyDqhOdjhKdL1mt02UpA0+e2nagKAChJoClEKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiEDI+p1TghEsBXS24cHxNIV7kJBx0FCqj2neR2Kc1ziMCMSBAoCCAEYklgSEwoMCgR1dGlhEgQ2MDAwEICb7gIaQDt5laDXsx0TdSb8gSf49ujTRDktrysSeGelAw/l+q2nU1GToXE9O/y2o4rfQ17yryuFJ/VyML/yTVizAKnHRsMYAg==",
"CiCGJ5oCbc9K8gUlhAlJjA39v5Y3nsGv57/q+qgjCU3XUhKpAgp8CnoKFi9wYXltZW50Lk1zZ1BheUZvckRhdGESYAovY2VsZXN0aWExcHlqNnlzdzI3bTJ1NGE3NDRtaHJuOXU5cWg2Y2E5ZDI4eWVwaG4SCPwuN2oIl+o/GJQDIiBlfXOx5XDFwCKWqylinahhcxN5W4W1XVON49G3lG86URJnClAKRgofL2Nvc21vcy5jcnlwdG8uc2VjcDI1NmsxLlB1YktleRIjCiEDCqv9ioKle4mSUz1R/cw/P0pcpYEMFpRZKnUT/XI9+QQSBAoCCAEYMhITCgwKBHV0aWESBDYwMDAQgJvuAhpAwI4LcqPuXHciSSQNMDh3k/2Bm76FqJLujQ+rtYW99DMk/OF30yvrnsA7AnQo4DfGq7jRKvnLMAtp8GYlEEIjVBgD",
}
encCfg := encoding.MakeConfig(app.ModuleEncodingRegisters...)
for _, tx := range txs {
rawTx, err := base64.StdEncoding.DecodeString(tx)
require.NoError(t, err)
sdkTx, err := encoding.MalleatedTxDecoder(encCfg.TxConfig.TxDecoder())(rawTx)
require.NoError(t, err)
for _, msg := range sdkTx.GetMsgs() {
fmt.Println(sdk.MsgTypeURL(msg))
}
}
} |
@xiaying-peng please close this issue after confirming 🙂 sorry I didn't notice the version at first glance! |
Ah, Thank you! It works! |
Summary of Bug
Unable to decode Pay For Data transaction using the standard CosmosSDK way
Version
29b84d8
Steps to Reproduce
I tried using the following code to decode the tx:
but got error:
Example: https://rpc-mocha.pops.one/block?height=199687
For Admin Use
The text was updated successfully, but these errors were encountered: