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

chore: update to 0.47 #337

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ on:
branches:
- main
paths:
- '**.go'
- '**.mod'
- '**.sum'
- "**.go"
- "**.mod"
- "**.sum"

jobs:
test-unit:
name: unit-tests
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: checkout ibctest
uses: actions/checkout@v3
Expand All @@ -38,10 +38,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: checkout ibctest
uses: actions/checkout@v3
Expand All @@ -59,10 +59,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: checkout ibctest
uses: actions/checkout@v3
Expand All @@ -80,10 +80,10 @@ jobs:
runs-on: [self-hosted, linux]
steps:
# Install and setup go
- name: Set up Go 1.18
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.18
go-version: 1.19

- name: checkout ibctest
uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion chain/cosmos/broadcaster.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (b *Broadcaster) defaultClientContext(fromUser User, sdkAdd sdk.AccAddress)
WithSkipConfirmation(true).
WithAccountRetriever(authtypes.AccountRetriever{}).
WithKeyring(kr).
WithBroadcastMode(flags.BroadcastBlock).
WithBroadcastMode(flags.BroadcastSync).
WithCodec(b.chain.cfg.EncodingConfig.Codec)

// NOTE: the returned context used to have .WithHomeDir(cn.Home),
Expand Down
65 changes: 45 additions & 20 deletions chain/cosmos/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,55 @@ package cosmos
import (
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/simapp"
simappparams "github.com/cosmos/cosmos-sdk/simapp/params"
"github.com/cosmos/cosmos-sdk/std"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module/testutil"
"github.com/cosmos/cosmos-sdk/x/auth"
authTx "github.com/cosmos/cosmos-sdk/x/auth/tx"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
transfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
ibctypes "github.com/cosmos/ibc-go/v6/modules/core/types"
)

func DefaultEncoding() simappparams.EncodingConfig {
// core modules
cfg := simappparams.MakeTestEncodingConfig()
std.RegisterLegacyAminoCodec(cfg.Amino)
std.RegisterInterfaces(cfg.InterfaceRegistry)
simapp.ModuleBasics.RegisterLegacyAminoCodec(cfg.Amino)
simapp.ModuleBasics.RegisterInterfaces(cfg.InterfaceRegistry)
"github.com/cosmos/cosmos-sdk/x/bank"
"github.com/cosmos/cosmos-sdk/x/capability"
"github.com/cosmos/cosmos-sdk/x/consensus"
distr "github.com/cosmos/cosmos-sdk/x/distribution"
"github.com/cosmos/cosmos-sdk/x/genutil"
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/cosmos/cosmos-sdk/x/gov"
govclient "github.com/cosmos/cosmos-sdk/x/gov/client"
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/params"
paramsclient "github.com/cosmos/cosmos-sdk/x/params/client"
"github.com/cosmos/cosmos-sdk/x/slashing"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/upgrade"
upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client"

// external modules
banktypes.RegisterInterfaces(cfg.InterfaceRegistry)
ibctypes.RegisterInterfaces(cfg.InterfaceRegistry)
transfertypes.RegisterInterfaces(cfg.InterfaceRegistry)
transfer "github.com/cosmos/ibc-go/v6/modules/apps/transfer"
ibccore "github.com/cosmos/ibc-go/v6/modules/core"
ibctm "github.com/cosmos/ibc-go/v6/modules/light-clients/07-tendermint"
)

return cfg
func DefaultEncoding() testutil.TestEncodingConfig {
return testutil.MakeTestEncodingConfig(
auth.AppModuleBasic{},
genutil.NewAppModuleBasic(genutiltypes.DefaultMessageValidator),
bank.AppModuleBasic{},
capability.AppModuleBasic{},
staking.AppModuleBasic{},
mint.AppModuleBasic{},
distr.AppModuleBasic{},
gov.NewAppModuleBasic(
[]govclient.ProposalHandler{
paramsclient.ProposalHandler,
upgradeclient.LegacyProposalHandler,
upgradeclient.LegacyCancelProposalHandler,
},
),
params.AppModuleBasic{},
slashing.AppModuleBasic{},
upgrade.AppModuleBasic{},
consensus.AppModuleBasic{},
transfer.AppModuleBasic{},
ibccore.AppModuleBasic{},
julienrbrt marked this conversation as resolved.
Show resolved Hide resolved
ibctm.AppModuleBasic{},
)
}

func decodeTX(interfaceRegistry codectypes.InterfaceRegistry, txbz []byte) (sdk.Tx, error) {
Expand Down
4 changes: 2 additions & 2 deletions chain/internal/tendermint/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ func AttributeValue(events []abcitypes.Event, eventType, attrKey string) (string
continue
}
for _, attr := range event.Attributes {
if string(attr.Key) == attrKey {
return string(attr.Value), true
if attr.Key == attrKey {
Copy link
Contributor

Choose a reason for hiding this comment

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

Did some troubleshooting here. Printed out both sides of this "if" and it looked like this:
attr.Key = cGFja2V0X2RhdGE=
attrKey = packet_sequence

Copy link
Contributor

Choose a reason for hiding this comment

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

Nice work! What chain binaries did you use to test this? It seems tendermint changed the event attribute key to be string instead of []byte. I'm wondering if the binary used is using a tendermint v0.37-rc2?

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @colin-axner.
I was just using the TestLearn in examples/ibc/learn_ibc_test.go. It's using some older versions:
gaia: v7.0.0
osmosis: v11.0.0

return attr.Value, true
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions chain/internal/tendermint/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import (
func TestAttributeValue(t *testing.T) {
events := []abcitypes.Event{
{Type: "1", Attributes: []abcitypes.EventAttribute{
{Key: []byte("ignore"), Value: []byte("should not see me")},
{Key: []byte("key1"), Value: []byte("found1")},
{Key: "ignore", Value: "should not see me"},
{Key: "key1", Value: "found1"},
}},
{Type: "2", Attributes: []abcitypes.EventAttribute{
{Key: []byte("key2"), Value: []byte("found2")},
{Key: []byte("ignore"), Value: []byte("should not see me")},
{Key: "key2", Value: "found2"},
{Key: "ignore", Value: "should not see me"},
}},
}

Expand Down
Loading