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

feat(nexus): msg dispatcher for routing messages from the wasm connection router to the nexus module #2000

Merged
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
3 changes: 3 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,9 @@ func NewAxelarApp(logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest
scopedWasmK := app.capabilityKeeper.ScopeToModule(wasm.ModuleName)
// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
wasmOpts = append(wasmOpts, wasmkeeper.WithMessageHandlerDecorator(func(old wasmkeeper.Messenger) wasmkeeper.Messenger {
return wasmkeeper.NewMessageHandlerChain(old, nexusKeeper.NewMessenger(nexusK))
}))
wasmK = wasm.NewKeeper(
appCodec,
keys[wasm.StoreKey],
Expand Down
38 changes: 38 additions & 0 deletions docs/proto/proto-docs.md

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

10 changes: 10 additions & 0 deletions proto/axelar/nexus/exported/v1beta1/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,13 @@ message GeneralMessage {
bytes source_tx_id = 7 [ (gogoproto.customname) = "SourceTxID" ];
uint64 source_tx_index = 8;
}

message WasmMessage {
string source_chain = 1 [ (gogoproto.casttype) = "ChainName" ];
string source_address = 2;
string destination_chain = 3 [ (gogoproto.casttype) = "ChainName" ];
string destination_address = 4;
bytes payload_hash = 5;
bytes source_tx_id = 6 [ (gogoproto.customname) = "SourceTxID" ];
uint64 source_tx_index = 7;
}
4 changes: 4 additions & 0 deletions proto/axelar/nexus/v1beta1/events.proto
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ message MessageProcessing { string id = 1 [ (gogoproto.customname) = "ID" ]; }
message MessageExecuted { string id = 1 [ (gogoproto.customname) = "ID" ]; }

message MessageFailed { string id = 1 [ (gogoproto.customname) = "ID" ]; }

message WasmMessageRouted {
exported.v1beta1.WasmMessage message = 1 [ (gogoproto.nullable) = false ];
}
11 changes: 5 additions & 6 deletions x/axelarnet/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import (
ibctypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v4/modules/core/02-client/types"
channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types"
ibcclient "github.com/cosmos/ibc-go/v4/modules/core/exported"
ibcexported "github.com/cosmos/ibc-go/v4/modules/core/exported"
ibc "github.com/cosmos/ibc-go/v4/modules/core/exported"
tmbytes "github.com/tendermint/tendermint/libs/bytes"
"github.com/tendermint/tendermint/libs/log"

Expand Down Expand Up @@ -89,15 +88,15 @@ type IBCTransferKeeper interface {
// ChannelKeeper defines the expected IBC channel keeper
type ChannelKeeper interface {
GetNextSequenceSend(ctx sdk.Context, portID, channelID string) (uint64, bool)
GetChannelClientState(ctx sdk.Context, portID, channelID string) (string, ibcclient.ClientState, error)
GetChannelClientState(ctx sdk.Context, portID, channelID string) (string, ibc.ClientState, error)

GetChannel(ctx sdk.Context, srcPort string, srcChan string) (channel channeltypes.Channel, found bool) // used in module_test
SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibcexported.PacketI) error // used in module_test
SendPacket(ctx sdk.Context, channelCap *capabilitytypes.Capability, packet ibc.PacketI) error // used in module_test
WriteAcknowledgement(
ctx sdk.Context,
chanCap *capabilitytypes.Capability,
packet ibcexported.PacketI,
ack ibcexported.Acknowledgement,
packet ibc.PacketI,
ack ibc.Acknowledgement,
) error
GetAppVersion(ctx sdk.Context, portID string, channelID string) (string, bool) // used in module_test
}
Expand Down
Loading
Loading