Add SignatureV2 infrastructure (#6373)
* Updte tx generator * Add sigv2, PublicKeyCodec * revert changes * revert changes * updates * Updates * Integrate multisig support * Undo move * remove func * undo * godocs * godocs, cleanup * Cleanup * godocs, tests * lint * Re-enable VerifyBytes * Address comments * Fix imports * Update crypto/types/multisig/multisignature.go * Add test for MultiSignatureData * Add nested multisig case * Add test for AddSignatureV2 * Add changelog Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com> Co-authored-by: sahith-narahari <sahithnarahari@gmail.com>
This commit is contained in:
co-authored by
Federico Kunze
sahith-narahari
parent
7871910359
commit
60f7edfe3d
@@ -0,0 +1,17 @@
|
||||
package signing
|
||||
|
||||
import "github.com/tendermint/tendermint/crypto"
|
||||
|
||||
// SignatureV2 is a convenience type that is easier to use in application logic
|
||||
// than the protobuf SignerInfo's and raw signature bytes. It goes beyond the
|
||||
// first sdk.Signature types by supporting sign modes and explicitly nested
|
||||
// multi-signatures. It is intended to be used for both building and verifying
|
||||
// signatures.
|
||||
type SignatureV2 struct {
|
||||
// PubKey is the public key to use for verifying the signature
|
||||
PubKey crypto.PubKey
|
||||
|
||||
// Data is the actual data of the signature which includes SignMode's and
|
||||
// the signatures themselves for either single or multi-signatures.
|
||||
Data SignatureData
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package signing
|
||||
|
||||
import (
|
||||
"github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
)
|
||||
|
||||
// SignatureData represents either a *SingleSignatureData or *MultiSignatureData.
|
||||
// It is a convenience type that is easier to use in buiness logic than the encoded
|
||||
// protobuf ModeInfo's and raw signatures.
|
||||
type SignatureData interface {
|
||||
isSignatureData()
|
||||
}
|
||||
|
||||
// SingleSignatureData represents the signature and SignMode of a single (non-multisig) signer
|
||||
type SingleSignatureData struct {
|
||||
// SignMode represents the SignMode of the signature
|
||||
SignMode SignMode
|
||||
|
||||
// SignMode represents the SignMode of the signature
|
||||
Signature []byte
|
||||
}
|
||||
|
||||
// MultiSignatureData represents the nested SignatureData of a multisig signature
|
||||
type MultiSignatureData struct {
|
||||
// BitArray is a compact way of indicating which signers from the multisig key
|
||||
// have signed
|
||||
BitArray *types.CompactBitArray
|
||||
|
||||
// Signatures is the nested SignatureData's for each signer
|
||||
Signatures []SignatureData
|
||||
}
|
||||
|
||||
var _, _ SignatureData = &SingleSignatureData{}, &MultiSignatureData{}
|
||||
|
||||
func (m *SingleSignatureData) isSignatureData() {}
|
||||
func (m *MultiSignatureData) isSignatureData() {}
|
||||
@@ -0,0 +1,84 @@
|
||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||
// source: types/tx/signing/types.proto
|
||||
|
||||
package signing
|
||||
|
||||
import (
|
||||
fmt "fmt"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
math "math"
|
||||
)
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// SignMode represents a signing mode with its own security guarantees
|
||||
type SignMode int32
|
||||
|
||||
const (
|
||||
// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected
|
||||
SignMode_SIGN_MODE_UNSPECIFIED SignMode = 0
|
||||
// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified
|
||||
// with raw bytes from Tx
|
||||
SignMode_SIGN_MODE_DIRECT SignMode = 1
|
||||
// SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable
|
||||
// textual representation on top of the binary representation from SIGN_MODE_DIRECT
|
||||
SignMode_SIGN_MODE_TEXTUAL SignMode = 2
|
||||
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
|
||||
// Amino JSON and will be removed in the future
|
||||
SignMode_SIGN_MODE_LEGACY_AMINO_JSON SignMode = 127
|
||||
)
|
||||
|
||||
var SignMode_name = map[int32]string{
|
||||
0: "SIGN_MODE_UNSPECIFIED",
|
||||
1: "SIGN_MODE_DIRECT",
|
||||
2: "SIGN_MODE_TEXTUAL",
|
||||
127: "SIGN_MODE_LEGACY_AMINO_JSON",
|
||||
}
|
||||
|
||||
var SignMode_value = map[string]int32{
|
||||
"SIGN_MODE_UNSPECIFIED": 0,
|
||||
"SIGN_MODE_DIRECT": 1,
|
||||
"SIGN_MODE_TEXTUAL": 2,
|
||||
"SIGN_MODE_LEGACY_AMINO_JSON": 127,
|
||||
}
|
||||
|
||||
func (x SignMode) String() string {
|
||||
return proto.EnumName(SignMode_name, int32(x))
|
||||
}
|
||||
|
||||
func (SignMode) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_52d5d5e2efced9ba, []int{0}
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("cosmos_sdk.tx.signing.v1.SignMode", SignMode_name, SignMode_value)
|
||||
}
|
||||
|
||||
func init() { proto.RegisterFile("types/tx/signing/types.proto", fileDescriptor_52d5d5e2efced9ba) }
|
||||
|
||||
var fileDescriptor_52d5d5e2efced9ba = []byte{
|
||||
// 222 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xa9, 0x2c, 0x48,
|
||||
0x2d, 0xd6, 0x2f, 0xa9, 0xd0, 0x2f, 0xce, 0x4c, 0xcf, 0xcb, 0xcc, 0x4b, 0xd7, 0x07, 0x0b, 0xe8,
|
||||
0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x49, 0x24, 0xe7, 0x17, 0xe7, 0xe6, 0x17, 0xc7, 0x17, 0xa7,
|
||||
0x64, 0xeb, 0x95, 0x54, 0xe8, 0x41, 0x95, 0xe8, 0x95, 0x19, 0x6a, 0x15, 0x73, 0x71, 0x04, 0x67,
|
||||
0xa6, 0xe7, 0xf9, 0xe6, 0xa7, 0xa4, 0x0a, 0x49, 0x72, 0x89, 0x06, 0x7b, 0xba, 0xfb, 0xc5, 0xfb,
|
||||
0xfa, 0xbb, 0xb8, 0xc6, 0x87, 0xfa, 0x05, 0x07, 0xb8, 0x3a, 0x7b, 0xba, 0x79, 0xba, 0xba, 0x08,
|
||||
0x30, 0x08, 0x89, 0x70, 0x09, 0x20, 0xa4, 0x5c, 0x3c, 0x83, 0x5c, 0x9d, 0x43, 0x04, 0x18, 0x85,
|
||||
0x44, 0xb9, 0x04, 0x11, 0xa2, 0x21, 0xae, 0x11, 0x21, 0xa1, 0x8e, 0x3e, 0x02, 0x4c, 0x42, 0xf2,
|
||||
0x5c, 0xd2, 0x08, 0x61, 0x1f, 0x57, 0x77, 0x47, 0xe7, 0xc8, 0x78, 0x47, 0x5f, 0x4f, 0x3f, 0xff,
|
||||
0x78, 0xaf, 0x60, 0x7f, 0x3f, 0x81, 0x7a, 0x27, 0xf7, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92,
|
||||
0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c,
|
||||
0x96, 0x63, 0x88, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x87,
|
||||
0xb8, 0x19, 0x4a, 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0xa3, 0xfb, 0x31, 0x89, 0x0d, 0xec, 0x3d, 0x63,
|
||||
0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa0, 0x11, 0xdd, 0x92, 0xfe, 0x00, 0x00, 0x00,
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
syntax = "proto3";
|
||||
package cosmos_sdk.tx.signing.v1;
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/types/tx/signing";
|
||||
|
||||
// SignMode represents a signing mode with its own security guarantees
|
||||
enum SignMode {
|
||||
// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected
|
||||
SIGN_MODE_UNSPECIFIED = 0;
|
||||
|
||||
// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified
|
||||
// with raw bytes from Tx
|
||||
SIGN_MODE_DIRECT = 1;
|
||||
|
||||
// SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable
|
||||
// textual representation on top of the binary representation from SIGN_MODE_DIRECT
|
||||
SIGN_MODE_TEXTUAL = 2;
|
||||
|
||||
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
|
||||
// Amino JSON and will be removed in the future
|
||||
SIGN_MODE_LEGACY_AMINO_JSON = 127;
|
||||
}
|
||||
+55
-98
@@ -9,6 +9,7 @@ import (
|
||||
types1 "github.com/cosmos/cosmos-sdk/crypto/types"
|
||||
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
|
||||
types2 "github.com/cosmos/cosmos-sdk/types"
|
||||
signing "github.com/cosmos/cosmos-sdk/types/tx/signing"
|
||||
_ "github.com/gogo/protobuf/gogoproto"
|
||||
proto "github.com/gogo/protobuf/proto"
|
||||
io "io"
|
||||
@@ -27,45 +28,6 @@ var _ = math.Inf
|
||||
// proto package needs to be updated.
|
||||
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
|
||||
// SignMode represents a signing mode with its own security guarantees
|
||||
type SignMode int32
|
||||
|
||||
const (
|
||||
// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected
|
||||
SignMode_SIGN_MODE_UNSPECIFIED SignMode = 0
|
||||
// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified
|
||||
// with raw bytes from Tx
|
||||
SignMode_SIGN_MODE_DIRECT SignMode = 1
|
||||
// SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable
|
||||
// textual representation on top of the binary representation from SIGN_MODE_DIRECT
|
||||
SignMode_SIGN_MODE_TEXTUAL SignMode = 2
|
||||
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
|
||||
// Amino JSON and will be removed in the future
|
||||
SignMode_SIGN_MODE_LEGACY_AMINO_JSON SignMode = 127
|
||||
)
|
||||
|
||||
var SignMode_name = map[int32]string{
|
||||
0: "SIGN_MODE_UNSPECIFIED",
|
||||
1: "SIGN_MODE_DIRECT",
|
||||
2: "SIGN_MODE_TEXTUAL",
|
||||
127: "SIGN_MODE_LEGACY_AMINO_JSON",
|
||||
}
|
||||
|
||||
var SignMode_value = map[string]int32{
|
||||
"SIGN_MODE_UNSPECIFIED": 0,
|
||||
"SIGN_MODE_DIRECT": 1,
|
||||
"SIGN_MODE_TEXTUAL": 2,
|
||||
"SIGN_MODE_LEGACY_AMINO_JSON": 127,
|
||||
}
|
||||
|
||||
func (x SignMode) String() string {
|
||||
return proto.EnumName(SignMode_name, int32(x))
|
||||
}
|
||||
|
||||
func (SignMode) EnumDescriptor() ([]byte, []int) {
|
||||
return fileDescriptor_1c6ac8fa65877134, []int{0}
|
||||
}
|
||||
|
||||
// Tx is the standard type used for broadcasting transactions
|
||||
type Tx struct {
|
||||
// body is the processable content of the transaction
|
||||
@@ -511,7 +473,7 @@ func (*ModeInfo) XXX_OneofWrappers() []interface{} {
|
||||
// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the future
|
||||
type ModeInfo_Single struct {
|
||||
// mode is the signing mode of the single signer
|
||||
Mode SignMode `protobuf:"varint,1,opt,name=mode,proto3,enum=cosmos_sdk.tx.v1.SignMode" json:"mode,omitempty"`
|
||||
Mode signing.SignMode `protobuf:"varint,1,opt,name=mode,proto3,enum=cosmos_sdk.tx.signing.v1.SignMode" json:"mode,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ModeInfo_Single) Reset() { *m = ModeInfo_Single{} }
|
||||
@@ -547,11 +509,11 @@ func (m *ModeInfo_Single) XXX_DiscardUnknown() {
|
||||
|
||||
var xxx_messageInfo_ModeInfo_Single proto.InternalMessageInfo
|
||||
|
||||
func (m *ModeInfo_Single) GetMode() SignMode {
|
||||
func (m *ModeInfo_Single) GetMode() signing.SignMode {
|
||||
if m != nil {
|
||||
return m.Mode
|
||||
}
|
||||
return SignMode_SIGN_MODE_UNSPECIFIED
|
||||
return signing.SignMode_SIGN_MODE_UNSPECIFIED
|
||||
}
|
||||
|
||||
// Multi is the mode info for a multisig public key
|
||||
@@ -669,7 +631,6 @@ func (m *Fee) GetGasLimit() uint64 {
|
||||
}
|
||||
|
||||
func init() {
|
||||
proto.RegisterEnum("cosmos_sdk.tx.v1.SignMode", SignMode_name, SignMode_value)
|
||||
proto.RegisterType((*Tx)(nil), "cosmos_sdk.tx.v1.Tx")
|
||||
proto.RegisterType((*SignDoc)(nil), "cosmos_sdk.tx.v1.SignDoc")
|
||||
proto.RegisterType((*TxBody)(nil), "cosmos_sdk.tx.v1.TxBody")
|
||||
@@ -684,60 +645,56 @@ func init() {
|
||||
func init() { proto.RegisterFile("types/tx/types.proto", fileDescriptor_1c6ac8fa65877134) }
|
||||
|
||||
var fileDescriptor_1c6ac8fa65877134 = []byte{
|
||||
// 842 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x4d, 0x6f, 0xe3, 0x44,
|
||||
0x18, 0x8e, 0x93, 0x34, 0x4d, 0xde, 0xee, 0x47, 0x3a, 0xb4, 0x92, 0x9b, 0xa2, 0x34, 0x44, 0x2a,
|
||||
0x04, 0x04, 0xce, 0xb2, 0x7b, 0x60, 0x11, 0x87, 0x55, 0x92, 0xa6, 0xdb, 0x40, 0x9b, 0xa2, 0x49,
|
||||
0x56, 0x82, 0x95, 0x90, 0xe5, 0xd8, 0x53, 0x67, 0xd4, 0x78, 0x26, 0x78, 0xc6, 0x28, 0xe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, 0x19, 0x85, 0x44, 0x98,
|
||||
0xb9, 0x5a, 0xae, 0x71, 0x0f, 0xdf, 0x40, 0xea, 0xbf, 0x1b, 0xb0, 0x39, 0xa0, 0x3e, 0x3b, 0xe2,
|
||||
0xee, 0xff, 0x95, 0xd2, 0x1e, 0x14, 0xdd, 0xb1, 0x43, 0x99, 0x4d, 0x3d, 0x33, 0x57, 0x33, 0x1a,
|
||||
0x25, 0xbc, 0xa9, 0x9e, 0x7b, 0x1e, 0x3a, 0x84, 0x07, 0x8e, 0xeb, 0xf2, 0x88, 0x49, 0x9b, 0x45,
|
||||
0xc1, 0x88, 0x84, 0x66, 0xbe, 0x66, 0x34, 0xf2, 0xf8, 0xbe, 0x46, 0xfb, 0x0a, 0x44, 0xef, 0x42,
|
||||
0x39, 0xa5, 0x09, 0xf2, 0x75, 0x44, 0x98, 0x4b, 0xcc, 0x0d, 0x45, 0x7c, 0xa8, 0xf1, 0x81, 0x86,
|
||||
0xeb, 0x3f, 0x67, 0xa1, 0x90, 0xa4, 0x8d, 0x1e, 0x41, 0x31, 0x20, 0x42, 0x38, 0x3e, 0x11, 0xa6,
|
||||
0x51, 0xcb, 0x35, 0xb6, 0x1e, 0xef, 0x58, 0xc9, 0x98, 0xac, 0x74, 0x4c, 0x56, 0x8b, 0xcd, 0xf1,
|
||||
0x82, 0x85, 0x10, 0xe4, 0x03, 0x12, 0x24, 0xd5, 0x95, 0xb0, 0x8a, 0xe3, 0x14, 0x25, 0x0d, 0x08,
|
||||
0x8f, 0xa4, 0x3d, 0x26, 0xd4, 0x1f, 0x4b, 0x55, 0x43, 0x0e, 0xdf, 0xd7, 0xe8, 0x89, 0x02, 0x51,
|
||||
0x1b, 0xb6, 0xc9, 0x4c, 0x12, 0x26, 0x28, 0x67, 0x36, 0x9f, 0x4a, 0xca, 0x99, 0x30, 0xff, 0xde,
|
||||
0x5c, 0x73, 0x6c, 0x79, 0xc1, 0x3f, 0x4f, 0xe8, 0xe8, 0x25, 0x54, 0x19, 0x67, 0xb6, 0x1b, 0x52,
|
||||
0x49, 0x5d, 0x67, 0x62, 0xdf, 0x61, 0xf8, 0x70, 0x8d, 0xe1, 0x3e, 0xe3, 0xac, 0xa3, 0xb5, 0xdd,
|
||||
0x5b, 0xde, 0x75, 0x09, 0xc5, 0x74, 0x34, 0xe8, 0x19, 0xdc, 0x8b, 0x37, 0x82, 0x84, 0x6a, 0x96,
|
||||
0x69, 0x73, 0xde, 0x5c, 0x1d, 0xe6, 0x40, 0xb1, 0xd4, 0x38, 0xb7, 0xc4, 0x22, 0x16, 0xe8, 0x1d,
|
||||
0xc8, 0x5d, 0x10, 0xa2, 0x97, 0x60, 0x77, 0x55, 0x77, 0x4c, 0x08, 0x8e, 0x19, 0xf5, 0x6f, 0x01,
|
||||
0x96, 0x1e, 0xe8, 0x09, 0xc0, 0x34, 0x1a, 0x4d, 0xa8, 0x6b, 0x5f, 0x92, 0x74, 0xeb, 0xee, 0x2e,
|
||||
0xa5, 0x94, 0xf0, 0x3e, 0x23, 0x6a, 0xed, 0x02, 0xee, 0x91, 0xff, 0x58, 0xbb, 0x33, 0xee, 0x91,
|
||||
0x64, 0xed, 0x02, 0x1d, 0xd5, 0x7f, 0xcd, 0x42, 0x31, 0x85, 0xd1, 0x27, 0x50, 0x10, 0x94, 0xf9,
|
||||
0x13, 0xa2, 0x8f, 0x7d, 0xeb, 0xdf, 0x2d, 0xac, 0x81, 0x22, 0x9e, 0x64, 0xb0, 0x96, 0xa0, 0xa7,
|
||||
0xb0, 0x11, 0x44, 0x13, 0x49, 0xf5, 0xf1, 0xb5, 0x35, 0xda, 0xb3, 0x98, 0x77, 0x92, 0xc1, 0x89,
|
||||
0xa0, 0xf2, 0x14, 0x0a, 0x89, 0x1b, 0xb2, 0x20, 0x1f, 0x67, 0xa6, 0x8e, 0x7f, 0x70, 0x57, 0x05,
|
||||
0x71, 0x9f, 0x62, 0x1b, 0xac, 0x78, 0x95, 0x1f, 0x0c, 0xd8, 0x50, 0x66, 0xa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0xf8, 0xa2, 0x75, 0x5a, 0xce, 0xa2,
|
||||
0x03, 0xd8, 0x5f, 0xc2, 0xa7, 0xdd, 0xe7, 0xad, 0xce, 0x97, 0x76, 0xeb, 0xac, 0xd7, 0x3f, 0xb7,
|
||||
0x3f, 0x1d, 0x9c, 0xf7, 0xcb, 0xdf, 0xb5, 0x9f, 0xbd, 0xba, 0xaa, 0x1a, 0xaf, 0xaf, 0xaa, 0xc6,
|
||||
0x5f, 0x57, 0x55, 0xe3, 0xa7, 0xeb, 0x6a, 0xe6, 0xf5, 0x75, 0x35, 0xf3, 0xdb, 0x75, 0x35, 0xf3,
|
||||
0xf2, 0x70, 0x7d, 0x75, 0xfa, 0x33, 0x34, 0x2a, 0xa8, 0xc5, 0x7e, 0xf2, 0x4f, 0x00, 0x00, 0x00,
|
||||
0xff, 0xff, 0x28, 0x03, 0x76, 0x89, 0x9f, 0x06, 0x00, 0x00,
|
||||
// 774 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x55, 0x3d, 0x6f, 0xe3, 0x46,
|
||||
0x10, 0x15, 0x45, 0x49, 0x96, 0xc6, 0xdf, 0x1b, 0x07, 0xa0, 0x65, 0x83, 0x56, 0x08, 0x38, 0x51,
|
||||
0x80, 0x84, 0x72, 0x6c, 0x20, 0x1f, 0x48, 0xe1, 0x48, 0x4e, 0x0c, 0x1b, 0x89, 0x13, 0x80, 0x72,
|
||||
0x65, 0x20, 0x20, 0x28, 0x72, 0x45, 0x2d, 0x2c, 0xee, 0x2a, 0xdc, 0x65, 0x20, 0xa5, 0x4b, 0x91,
|
||||
0x2a, 0x4d, 0x9a, 0xfc, 0x89, 0xfb, 0x25, 0x2e, 0x8d, 0xab, 0xae, 0xb9, 0x0f, 0xd8, 0x3f, 0xe4,
|
||||
0x0e, 0x5c, 0x2e, 0x65, 0x9f, 0xe5, 0xd3, 0x75, 0x57, 0x69, 0x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0x23, 0xf3, 0x3f, 0x54, 0x49, 0x9b, 0x50, 0xf5,
|
||||
0x07, 0x1e, 0xa1, 0x2e, 0x09, 0x0c, 0xbd, 0xa1, 0x35, 0x6b, 0xce, 0x82, 0x7c, 0x3e, 0x0d, 0xd0,
|
||||
0x2e, 0xac, 0x78, 0xbe, 0xcf, 0x12, 0x2a, 0x5c, 0x9a, 0x44, 0x3d, 0x1c, 0x1b, 0xa5, 0x86, 0xd6,
|
||||
0x2c, 0x39, 0xcb, 0x0a, 0xfd, 0x55, 0x82, 0xe8, 0x73, 0x58, 0xcb, 0x69, 0x1c, 0xff, 0x91, 0x60,
|
||||
0xea, 0x63, 0xa3, 0x2c, 0x89, 0xab, 0x0a, 0xef, 0x2a, 0xd8, 0xfa, 0xbf, 0x08, 0x95, 0xac, 0x6c,
|
||||
0xb4, 0x07, 0xd5, 0x08, 0x73, 0xee, 0x85, 0x98, 0x1b, 0x5a, 0x43, 0x6f, 0x2e, 0xee, 0x6f, 0xd8,
|
||||
0xd9, 0x98, 0xec, 0x7c, 0x4c, 0x76, 0x9b, 0x4e, 0x9c, 0x29, 0x0b, 0x21, 0x28, 0x45, 0x38, 0xca,
|
||||
0x4e, 0x57, 0x73, 0x64, 0x9c, 0x96, 0x28, 0x48, 0x84, 0x59, 0x22, 0xdc, 0x01, 0x26, 0xe1, 0x40,
|
||||
0xc8, 0x33, 0xe8, 0xce, 0xb2, 0x42, 0x4f, 0x24, 0x88, 0x3a, 0xb0, 0x8e, 0xc7, 0x02, 0x53, 0x4e,
|
||||
0x18, 0x75, 0xd9, 0x48, 0x10, 0x46, 0xb9, 0xf1, 0x7a, 0x61, 0x4e, 0xda, 0xb5, 0x29, 0xff, 0xb7,
|
||||
0x8c, 0x8e, 0x2e, 0xc0, 0xa4, 0x8c, 0xba, 0x7e, 0x4c, 0x04, 0xf1, 0xbd, 0xa1, 0xfb, 0x88, 0xe1,
|
||||
0xea, 0x1c, 0xc3, 0x2d, 0xca, 0xe8, 0x91, 0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2e, 0xd9, 0x5d, 0x96, 0x3a, 0x1c, 0xb1, 0x68, 0xe4, 0xf9, 0xa2,
|
||||
0x43, 0x44, 0x3b, 0x25, 0x3b, 0x53, 0x19, 0xfa, 0x0e, 0x60, 0xda, 0x4b, 0x6e, 0x14, 0xe5, 0xd8,
|
||||
0xe7, 0x35, 0xb3, 0x96, 0x37, 0x93, 0x77, 0xca, 0xa0, 0xf3, 0x24, 0xb2, 0xfe, 0xd6, 0x40, 0x3f,
|
||||
0xc6, 0x18, 0xfd, 0x0e, 0x15, 0x2f, 0x4a, 0xff, 0x78, 0x6a, 0x79, 0x3e, 0xba, 0xef, 0x22, 0x6b,
|
||||
0x20, 0xb4, 0xb3, 0x77, 0xf5, 0x62, 0xa7, 0xf0, 0xe4, 0xe5, 0x4e, 0x33, 0x24, 0x62, 0x90, 0xf4,
|
||||
0x6c, 0x9f, 0x45, 0xad, 0x8c, 0xa6, 0x7e, 0xbe, 0xe4, 0xc1, 0xa5, 0xba, 0x46, 0x53, 0x01, 0x77,
|
||||
0x94, 0x29, 0xda, 0x82, 0x5a, 0xe8, 0x71, 0x77, 0x48, 0x22, 0x22, 0x64, 0xd7, 0x4b, 0x4e, 0x35,
|
||||
0xf4, 0xf8, 0x2f, 0xe9, 0x73, 0xe7, 0xf0, 0xea, 0xc6, 0xd4, 0xae, 0x6f, 0x4c, 0xed, 0xd5, 0x8d,
|
||||
0xa9, 0xfd, 0x77, 0x6b, 0x16, 0xae, 0x6f, 0xcd, 0xc2, 0xb3, 0x5b, 0xb3, 0x70, 0xb1, 0x3b, 0x3f,
|
||||
0x91, 0xfa, 0x6e, 0xf4, 0x2a, 0x72, 0xd7, 0x0e, 0xde, 0x04, 0x00, 0x00, 0xff, 0xff, 0x03, 0x5c,
|
||||
0xe0, 0x71, 0x50, 0x06, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *Tx) Marshal() (dAtA []byte, err error) {
|
||||
@@ -2424,7 +2381,7 @@ func (m *ModeInfo_Single) Unmarshal(dAtA []byte) error {
|
||||
}
|
||||
b := dAtA[iNdEx]
|
||||
iNdEx++
|
||||
m.Mode |= SignMode(b&0x7F) << shift
|
||||
m.Mode |= signing.SignMode(b&0x7F) << shift
|
||||
if b < 0x80 {
|
||||
break
|
||||
}
|
||||
|
||||
+2
-19
@@ -4,6 +4,7 @@ package cosmos_sdk.tx.v1;
|
||||
import "third_party/proto/gogoproto/gogo.proto";
|
||||
import "crypto/types/types.proto";
|
||||
import "types/types.proto";
|
||||
import "types/tx/signing/types.proto";
|
||||
import "google/protobuf/any.proto";
|
||||
|
||||
option go_package = "github.com/cosmos/cosmos-sdk/tx/types";
|
||||
@@ -104,7 +105,7 @@ message ModeInfo {
|
||||
// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the future
|
||||
message Single {
|
||||
// mode is the signing mode of the single signer
|
||||
SignMode mode = 1;
|
||||
cosmos_sdk.tx.signing.v1.SignMode mode = 1;
|
||||
}
|
||||
|
||||
// Multi is the mode info for a multisig public key
|
||||
@@ -118,24 +119,6 @@ message ModeInfo {
|
||||
}
|
||||
}
|
||||
|
||||
// SignMode represents a signing mode with its own security guarantees
|
||||
enum SignMode {
|
||||
// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be rejected
|
||||
SIGN_MODE_UNSPECIFIED = 0;
|
||||
|
||||
// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is verified
|
||||
// with raw bytes from Tx
|
||||
SIGN_MODE_DIRECT = 1;
|
||||
|
||||
// SIGN_MODE_TEXTUAL is a future signing mode that will verify some human-readable
|
||||
// textual representation on top of the binary representation from SIGN_MODE_DIRECT
|
||||
SIGN_MODE_TEXTUAL = 2;
|
||||
|
||||
// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses
|
||||
// Amino JSON and will be removed in the future
|
||||
SIGN_MODE_LEGACY_AMINO_JSON = 127;
|
||||
}
|
||||
|
||||
// Fee includes the amount of coins paid in fees and the maximum
|
||||
// gas to be used by the transaction. The ratio yields an effective "gasprice",
|
||||
// which must be above some miminum to be accepted into the mempool.
|
||||
|
||||
Reference in New Issue
Block a user