chore: migrate sdk.Msg to transaction.type (#20273)

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Hieu Vu <72878483+hieuvubk@users.noreply.github.com>
This commit is contained in:
Marko
2024-05-10 10:23:22 +00:00
committed by GitHub
co-authored by coderabbitai[bot] Hieu Vu
parent 98471350e4
commit 62b0b26d0c
55 changed files with 358 additions and 488 deletions
+3 -3
View File
@@ -26,12 +26,12 @@ type BlockRequest[T any] struct {
ChainId string
AppHash []byte
Txs []T
ConsensusMessages []transaction.Type
ConsensusMessages []transaction.Msg
}
type BlockResponse struct {
Apphash []byte
ConsensusMessagesResponse []transaction.Type
ConsensusMessagesResponse []transaction.Msg
ValidatorUpdates []appmodulev2.ValidatorUpdate
PreBlockEvents []event.Event
BeginBlockEvents []event.Event
@@ -54,7 +54,7 @@ type ResponseInitChain struct {
type TxResult struct {
Events []event.Event
Resp []transaction.Type
Resp []transaction.Msg
Error error
Code uint32
Data []byte
-1
View File
@@ -52,5 +52,4 @@ func TestInfo_FromBytes(t *testing.T) {
require.Equal(t, time.Date(2024, time.January, 1, 0, 0, 0, 0, time.UTC), info.Time)
require.Equal(t, []byte{0x26, 0xb0, 0xb8, 0x3e, 0x72, 0x81, 0xbe, 0x3b, 0x11, 0x76, 0x58, 0xb6, 0xf2, 0x63, 0x6d, 0x3, 0x68, 0xca, 0xd3, 0xd7, 0x4f, 0x22, 0x24, 0x34, 0x28, 0xf5, 0x40, 0x1a, 0x4b, 0x70, 0x89, 0x7e}, info.AppHash)
require.Equal(t, "test-chain", info.ChainID)
}
+4 -4
View File
@@ -1,11 +1,11 @@
package transaction
import (
"google.golang.org/protobuf/proto"
"github.com/cosmos/gogoproto/proto"
)
type (
Type = proto.Message
Msg = proto.Message
Identity = []byte
)
@@ -18,9 +18,9 @@ type Codec[T Tx] interface {
type Tx interface {
// Hash returns the unique identifier for the Tx.
Hash() [32]byte // TODO evaluate if 32 bytes is the right size & benchmark overhead of hashing instead of using identifier
Hash() [32]byte
// GetMessages returns the list of state transitions of the Tx.
GetMessages() ([]Type, error)
GetMessages() []Msg
// GetSenders returns the tx state transition sender.
GetSenders() ([]Identity, error) // TODO reduce this to a single identity if accepted
// GetGasLimit returns the gas limit of the tx. Must return math.MaxUint64 for infinite gas