Skip to content

Commit

Permalink
fix(x/auth/tx): JSON TX encoding/decoding (backport #20803) (#21125)
Browse files Browse the repository at this point in the history
Co-authored-by: Matt Kocubinski <[email protected]>
  • Loading branch information
mergify[bot] and kocubinski authored Jul 31, 2024
1 parent 2b7826d commit 1b27e4f
Show file tree
Hide file tree
Showing 11 changed files with 288 additions and 72 deletions.
9 changes: 9 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@
"program": "${workspaceFolder}/simapp/v2/simdv2",
"args": ["start"],
"buildFlags": ""
},
{
"name": "Start: simapp/v1",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceFolder}/simapp/simd",
"args": ["start"],
"buildFlags": ""
}
]
}
8 changes: 8 additions & 0 deletions testutil/testdata/testpb/tx.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "amino/amino.proto";
import "gogoproto/gogo.proto";
import "testpb/testdata.proto";
import "cosmos/msg/v1/msg.proto";
import "cosmos_proto/cosmos.proto";

option go_package = "github.com/cosmos/cosmos-sdk/testutil/testdata";

Expand Down Expand Up @@ -35,4 +36,11 @@ message TestMsg {
option (amino.name) = "testpb/TestMsg";

repeated string signers = 1;

string decField = 2 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(amino.dont_omitempty) = true,
(gogoproto.nullable) = false
];
}
108 changes: 94 additions & 14 deletions testutil/testdata/testpb/tx.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion testutil/testdata/tx.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package testdata

import (
"cosmossdk.io/math"
"testing"

"gotest.tools/v3/assert"
Expand Down Expand Up @@ -81,7 +82,8 @@ func NewTestMsg(addrs ...sdk.AccAddress) *TestMsg {
}

return &TestMsg{
Signers: accAddresses,
Signers: accAddresses,
DecField: math.LegacyZeroDec(),
}
}

Expand Down
Loading

0 comments on commit 1b27e4f

Please sign in to comment.