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

refactor(nexus): general message deprecated methods removal #2011

Merged
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 0 additions & 2 deletions x/axelarnet/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ type Nexus interface {
IsChainActivated(ctx sdk.Context, chain nexus.Chain) bool
RateLimitTransfer(ctx sdk.Context, chain nexus.ChainName, asset sdk.Coin, direction nexus.TransferDirection) error
GetMessage(ctx sdk.Context, id string) (m nexus.GeneralMessage, found bool)
SetNewMessage(ctx sdk.Context, m nexus.GeneralMessage) error
SetNewMessage_(ctx sdk.Context, m nexus.GeneralMessage) error
SetMessageProcessing(ctx sdk.Context, id string) error
SetMessageProcessing_(ctx sdk.Context, id string) error
SetMessageExecuted(ctx sdk.Context, id string) error
SetMessageFailed(ctx sdk.Context, id string) error
Expand Down
100 changes: 0 additions & 100 deletions x/axelarnet/types/mock/expected_keepers.go

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

8 changes: 3 additions & 5 deletions x/evm/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,11 @@ func setMessageToNexus(ctx sdk.Context, n types.Nexus, event types.Event, asset
Address: e.ContractCall.ContractAddress,
}

message = nexus.NewGeneralMessage(
message = nexus.NewGeneralMessage_(
string(event.GetID()),
sender,
recipient,
e.ContractCall.PayloadHash.Bytes(),
nexus.Approved,
event.TxID.Bytes(),
event.Index,
nil,
Expand All @@ -240,12 +239,11 @@ func setMessageToNexus(ctx sdk.Context, n types.Nexus, event types.Event, asset
Address: e.ContractCallWithToken.ContractAddress,
}

message = nexus.NewGeneralMessage(
message = nexus.NewGeneralMessage_(
string(event.GetID()),
sender,
recipient,
e.ContractCallWithToken.PayloadHash.Bytes(),
nexus.Approved,
event.TxID.Bytes(),
event.Index,
asset,
Expand All @@ -258,7 +256,7 @@ func setMessageToNexus(ctx sdk.Context, n types.Nexus, event types.Event, asset
return fmt.Errorf("%s is not a supported recipient", axelarnet.Axelarnet.Name)
}

return n.SetNewMessage(ctx, message)
return n.SetNewMessage_(ctx, message)
}

func handleConfirmDeposit(ctx sdk.Context, event types.Event, bk types.BaseKeeper, n types.Nexus) error {
Expand Down
4 changes: 2 additions & 2 deletions x/evm/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ func TestHandleContractCall(t *testing.T) {

setGeneralMessageSucceed := func(isSuccessful bool) func() {
return func() {
n.SetNewMessageFunc = func(sdk.Context, nexus.GeneralMessage) error {
n.SetNewMessage_Func = func(sdk.Context, nexus.GeneralMessage) error {
if !isSuccessful {
return fmt.Errorf("set general message error")
}
Expand Down Expand Up @@ -553,7 +553,7 @@ func TestHandleContractCall(t *testing.T) {
Then("should succeed", func(t *testing.T) {
err := handleContractCall(ctx, event, bk, n, multisigKeeper)
assert.NoError(t, err)
assert.Len(t, n.SetNewMessageCalls(), 1)
assert.Len(t, n.SetNewMessage_Calls(), 1)
}).
Run(t)
}
Expand Down
2 changes: 1 addition & 1 deletion x/evm/types/expected_keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ type Nexus interface {
GetChainMaintainerState(ctx sdk.Context, chain nexus.Chain, address sdk.ValAddress) (nexus.MaintainerState, bool)
SetChainMaintainerState(ctx sdk.Context, maintainerState nexus.MaintainerState) error
RateLimitTransfer(ctx sdk.Context, chain nexus.ChainName, asset sdk.Coin, direction nexus.TransferDirection) error
SetNewMessage(ctx sdk.Context, m nexus.GeneralMessage) error
SetNewMessage_(ctx sdk.Context, m nexus.GeneralMessage) error
GetProcessingMessages(ctx sdk.Context, chain nexus.ChainName, limit int64) []nexus.GeneralMessage
SetMessageFailed(ctx sdk.Context, id string) error
SetMessageExecuted(ctx sdk.Context, id string) error
Expand Down
42 changes: 21 additions & 21 deletions x/evm/types/mock/expected_keepers.go

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

Loading
Loading