Skip to content

Commit

Permalink
fix(go): implement GetSignBytes for MsgDepositDeployment
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Troian <[email protected]>
  • Loading branch information
troian committed Nov 14, 2024
1 parent 7fe522f commit b4dbcae
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
19 changes: 19 additions & 0 deletions go/node/deployment/v1/codec.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package v1

import (
"github.com/cosmos/cosmos-sdk/codec"
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
)

var (
// ModuleCdc references the global x/deployment module codec. Note, the codec should
// ONLY be used in certain instances of tests and for JSON encoding as Amino is
// still used for that purpose.
//
// The actual codec used for serialization should be provided to x/deployment and
// defined at the application level.
//
// Deprecated: ModuleCdc use is deprecated
ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry())
)

13 changes: 13 additions & 0 deletions go/node/deployment/v1/msgs.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package v1

import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

// GetSignBytes encodes the message for signing
//
// Deprecated: GetSignBytes is deprecated
func (msg *MsgDepositDeployment) GetSignBytes() []byte {
return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg))
}

3 changes: 1 addition & 2 deletions proto/node/akash/deployment/v1/msg.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import "akash/deployment/v1/deployment.proto";

option go_package = "pkg.akt.dev/go/node/deployment/v1";


// MsgDepositDeployment deposits more funds into the deposit account
message MsgDepositDeployment {
option (gogoproto.equal) = false;
Expand All @@ -36,5 +35,5 @@ message MsgDepositDeployment {
];
}

// MsgCreateDeploymentResponse defines the Msg/CreateDeployment response type.
// MsgDepositDeploymentResponse defines response type for the MsgDepositDeployment.
message MsgDepositDeploymentResponse {}

0 comments on commit b4dbcae

Please sign in to comment.