diff --git a/cmd/main.go b/cmd/main.go index 002903836..08de6d015 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -7,6 +7,8 @@ import ( "strings" "time" + "github.com/zoobc/zoobc-core/cmd/parser" + "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/zoobc/zoobc-core/cmd/account" @@ -48,6 +50,10 @@ func main() { Use: "generate", Short: "generate command is a parent command for generating stuffs", } + parserCmd = &cobra.Command{ + Use: "parser", + Short: "parse data to understandable struct", + } ) sqliteDbInstance = database.NewSqliteDB() @@ -67,9 +73,11 @@ func main() { rootCmd.AddCommand(generateCmd) rootCmd.AddCommand(genesisblock.Commands()) rootCmd.AddCommand(rollback.Commands(sqliteDB)) + rootCmd.AddCommand(parserCmd) generateCmd.AddCommand(account.Commands()) generateCmd.AddCommand(transaction.Commands(sqliteDB)) generateCmd.AddCommand(block.Commands()) + parserCmd.AddCommand(parser.Commands()) _ = rootCmd.Execute() } diff --git a/cmd/parser/cmd.go b/cmd/parser/cmd.go new file mode 100644 index 000000000..c65a425a1 --- /dev/null +++ b/cmd/parser/cmd.go @@ -0,0 +1,58 @@ +package parser + +import ( + "encoding/hex" + "fmt" + "strconv" + "strings" + + "github.com/spf13/cobra" + "github.com/zoobc/zoobc-core/common/transaction" +) + +var ( + /* + Transaction Parser Command + */ + txParserCmd = &cobra.Command{ + Use: "tx", + Short: "parse transaction from its hex representation", + Long: "transaction parser to check the content of your transaction hex", + } +) + +func init() { + txParserCmd.Flags().StringVar(&parserTxHex, "transaction-hex", "", "hex string of the transaction bytes") + txParserCmd.Flags().StringVar(&parserTxBytes, "transaction-bytes", "", "transaction bytes separated by `, `. eg:"+ + "--transaction-bytes='1, 222, 54, 12, 32'") +} + +func Commands() *cobra.Command { + txParserCmd.Run = ParseTransaction + return txParserCmd +} + +func ParseTransaction(*cobra.Command, []string) { + var txBytes []byte + if parserTxHex != "" { + txBytes, _ = hex.DecodeString(parserTxHex) + } else { + txByteCharSlice := strings.Split(parserTxBytes, ", ") + for _, v := range txByteCharSlice { + byteValue, err := strconv.Atoi(v) + if err != nil { + panic("failed to parse transaction bytes") + } + txBytes = append(txBytes, byte(byteValue)) + } + } + tx, err := (&transaction.Util{}).ParseTransactionBytes(txBytes, false) + if err != nil { + panic("error parsing tx" + err.Error()) + } + tx.TransactionBody, err = (&transaction.MultiSignatureTransaction{}).ParseBodyBytes(tx.TransactionBodyBytes) + if err != nil { + panic("error parsing tx body" + err.Error()) + } + fmt.Printf("transaction:\n%v\n", tx) +} diff --git a/cmd/parser/const.go b/cmd/parser/const.go new file mode 100644 index 000000000..a910c55a7 --- /dev/null +++ b/cmd/parser/const.go @@ -0,0 +1,7 @@ +package parser + +var ( + // txParser + parserTxHex string + parserTxBytes string +) diff --git a/cmd/transaction/cmd.go b/cmd/transaction/cmd.go index 7dea7ac2b..1d930a5c1 100644 --- a/cmd/transaction/cmd.go +++ b/cmd/transaction/cmd.go @@ -2,6 +2,7 @@ package transaction import ( "database/sql" + "fmt" "time" "github.com/spf13/cobra" @@ -54,6 +55,12 @@ var ( Short: "transaction sub command used to generate 'escrow approval' transaction", Long: "transaction sub command used to generate 'escrow approval' transaction. required transaction id and approval = true:false", } + multiSigCmd = &cobra.Command{ + Use: "multi-signature", + Short: "transaction sub command used to generate 'multi signature' transaction", + Long: "transaction sub command used to generate 'multi signature' transaction that require multiple account to submit their signature " + + "before it is valid to be executed", + } ) func init() { @@ -124,6 +131,18 @@ func init() { */ escrowApprovalCmd.Flags().Int64Var(&transactionID, "transaction-id", 0, "escrow approval body field which is int64") escrowApprovalCmd.Flags().BoolVar(&approval, "approval", false, "escrow approval body field which is bool") + /* + MultiSig Command + */ + multiSigCmd.Flags().StringSliceVar(&addresses, "addresses", []string{}, "list of participants "+ + "--addresses='address1,address2'") + multiSigCmd.Flags().Int64Var(&nonce, "nonce", 0, "random number / access code for the multisig info") + multiSigCmd.Flags().Uint32Var(&minSignature, "min-signature", 0, "minimum number of signature required for the transaction "+ + "to be valid") + multiSigCmd.Flags().StringVar(&unsignedTxHex, "unsigned-transaction", "", "hex string of the unsigned transaction bytes") + multiSigCmd.Flags().StringVar(&txHash, "transaction-hash", "", "hash of transaction being signed by address-signature list (hex)") + multiSigCmd.Flags().StringSliceVar(&addressSignatures, "address-signatures", []string{}, "address-signature list "+ + "--address-signatures='address1-signature1,address2-signature2'") } // Commands set TXGeneratorCommandsInstance that will used by whole commands @@ -148,6 +167,8 @@ func Commands(sqliteDB *sql.DB) *cobra.Command { txCmd.AddCommand(removeAccountDatasetCmd) escrowApprovalCmd.Run = txGeneratorCommandsInstance.EscrowApprovalProcess() txCmd.AddCommand(escrowApprovalCmd) + multiSigCmd.Run = txGeneratorCommandsInstance.MultiSignatureProcess() + txCmd.AddCommand(multiSigCmd) return txCmd } @@ -258,3 +279,16 @@ func (*TXGeneratorCommands) EscrowApprovalProcess() RunCommand { PrintTx(GenerateSignedTxBytes(tx, senderSeed), outputType) } } + +// MultiSignatureProcess for generate TX MultiSignature type +func (*TXGeneratorCommands) MultiSignatureProcess() RunCommand { + return func(ccmd *cobra.Command, args []string) { + tx := GenerateBasicTransaction(senderSeed, version, timestamp, fee, recipientAccountAddress) + tx = GeneratedMultiSignatureTransaction(tx, minSignature, nonce, unsignedTxHex, txHash, addressSignatures, addresses) + if tx == nil { + fmt.Printf("fail to generate transaction, please check the provided parameter") + } else { + PrintTx(GenerateSignedTxBytes(tx, senderSeed), outputType) + } + } +} diff --git a/cmd/transaction/const.go b/cmd/transaction/const.go index 08b1da4e7..5dd3189e0 100644 --- a/cmd/transaction/const.go +++ b/cmd/transaction/const.go @@ -12,6 +12,7 @@ var ( "setupAccountDataset": {3, 0, 0, 0}, "removeAccountDataset": {3, 1, 0, 0}, "approvalEscrow": {4, 0, 0, 0}, + "multiSignature": {5, 0, 0, 0}, } signature = &crypto.Signature{} @@ -46,4 +47,12 @@ var ( // escrowApproval approval bool transactionID int64 + + // multiSignature + unsignedTxHex string + addressSignatures []string + txHash string + addresses []string + nonce int64 + minSignature uint32 ) diff --git a/cmd/transaction/generator.go b/cmd/transaction/generator.go index b670854ee..09fffdf5d 100644 --- a/cmd/transaction/generator.go +++ b/cmd/transaction/generator.go @@ -276,6 +276,7 @@ func GenerateSignedTxBytes(tx *model.Transaction, senderSeed string) []byte { senderSeed, ) signedTxBytes, _ := transactionUtil.GetTransactionBytes(tx, true) + fmt.Printf("signedBytes: %v\n", len(signedTxBytes)) return signedTxBytes } @@ -324,3 +325,77 @@ func GenerateEscrowedTransaction( } return tx } + +/* +GeneratedMultiSignatureTransaction inject escrow. Need: + 1. unsignedTxHex + 2. signatures + 3. multisigInfo: + - minSignature + - nonce + - addresses +Invalid escrow validation when those fields has not set +*/ +func GeneratedMultiSignatureTransaction( + tx *model.Transaction, + minSignature uint32, + nonce int64, + unsignedTxHex, txHash string, + addressSignatures, addresses []string, +) *model.Transaction { + var ( + signatures = make(map[string][]byte) + signatureInfo *model.SignatureInfo + unsignedTx []byte + multiSigInfo *model.MultiSignatureInfo + err error + ) + if minSignature > 0 && len(addresses) > 0 { + multiSigInfo = &model.MultiSignatureInfo{ + MinimumSignatures: minSignature, + Nonce: nonce, + Addresses: addresses, + } + } + if unsignedTxHex != "" { + unsignedTx, err = hex.DecodeString(unsignedTxHex) + if err != nil { + return nil + } + } + + if txHash != "" { + transactionHash, err := hex.DecodeString(txHash) + if err != nil { + return nil + } + for _, v := range addressSignatures { + asig := strings.Split(v, "-") + if len(asig) < 2 { + return nil + } + signature, err := hex.DecodeString(asig[1]) + if err != nil { + return nil + } + signatures[asig[0]] = signature + } + signatureInfo = &model.SignatureInfo{ + TransactionHash: transactionHash, + Signatures: signatures, + } + } + + tx.TransactionType = util.ConvertBytesToUint32(txTypeMap["multiSignature"]) + txBody := &model.MultiSignatureTransactionBody{ + MultiSignatureInfo: multiSigInfo, + UnsignedTransactionBytes: unsignedTx, + SignatureInfo: signatureInfo, + } + tx.TransactionBodyBytes = (&transaction.MultiSignatureTransaction{ + Body: txBody, + }).GetBodyBytes() + fmt.Printf("length: %v\n", len(tx.TransactionBodyBytes)) + tx.TransactionBodyLength = uint32(len(tx.TransactionBodyBytes)) + return tx +} diff --git a/common/constant/fieldsSize.go b/common/constant/fieldsSize.go index e03207f62..549f1011e 100644 --- a/common/constant/fieldsSize.go +++ b/common/constant/fieldsSize.go @@ -35,4 +35,20 @@ var ( EscrowID uint32 = 8 EscrowApprovalBytesLength = EscrowApproval + EscrowID EscrowInstructionLength uint32 = 4 + MultisigFieldLength uint32 = 4 + // MultiSigFieldMissing indicate fields is missing, no need to read the bytes + MultiSigFieldMissing uint32 + // MultiSigFieldPresent indicate fields is present, parse the byte accordingly + MultiSigFieldPresent uint32 = 1 + MultiSigAddressLength uint32 = 4 + MultiSigSignatureLength uint32 = 4 + MultiSigSignatureAddressLength uint32 = 4 + MultiSigNumberOfAddress uint32 = 4 + MultiSigNumberOfSignatures uint32 = 4 + MultiSigUnsignedTxBytesLength uint32 = 4 + MultiSigInfoSize uint32 = 4 + MultiSigInfoSignatureInfoSize uint32 = 4 + MultiSigInfoNonce uint32 = 8 + MultiSigInfoMinSignature uint32 = 4 + MultiSigTransactionHash uint32 = 32 ) diff --git a/common/model/multiSignature.pb.go b/common/model/multiSignature.pb.go new file mode 100644 index 000000000..51c572328 --- /dev/null +++ b/common/model/multiSignature.pb.go @@ -0,0 +1,152 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: model/multiSignature.proto + +package model + +import ( + fmt "fmt" + proto "github.com/golang/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.ProtoPackageIsVersion3 // please upgrade the proto package + +type MultiSignatureInfo struct { + MinimumSignatures uint32 `protobuf:"varint,1,opt,name=MinimumSignatures,proto3" json:"MinimumSignatures,omitempty"` + Nonce int64 `protobuf:"varint,2,opt,name=Nonce,proto3" json:"Nonce,omitempty"` + Addresses []string `protobuf:"bytes,3,rep,name=Addresses,proto3" json:"Addresses,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MultiSignatureInfo) Reset() { *m = MultiSignatureInfo{} } +func (m *MultiSignatureInfo) String() string { return proto.CompactTextString(m) } +func (*MultiSignatureInfo) ProtoMessage() {} +func (*MultiSignatureInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_136af44c597c17ae, []int{0} +} + +func (m *MultiSignatureInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MultiSignatureInfo.Unmarshal(m, b) +} +func (m *MultiSignatureInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MultiSignatureInfo.Marshal(b, m, deterministic) +} +func (m *MultiSignatureInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiSignatureInfo.Merge(m, src) +} +func (m *MultiSignatureInfo) XXX_Size() int { + return xxx_messageInfo_MultiSignatureInfo.Size(m) +} +func (m *MultiSignatureInfo) XXX_DiscardUnknown() { + xxx_messageInfo_MultiSignatureInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiSignatureInfo proto.InternalMessageInfo + +func (m *MultiSignatureInfo) GetMinimumSignatures() uint32 { + if m != nil { + return m.MinimumSignatures + } + return 0 +} + +func (m *MultiSignatureInfo) GetNonce() int64 { + if m != nil { + return m.Nonce + } + return 0 +} + +func (m *MultiSignatureInfo) GetAddresses() []string { + if m != nil { + return m.Addresses + } + return nil +} + +type SignatureInfo struct { + TransactionHash []byte `protobuf:"bytes,1,opt,name=TransactionHash,proto3" json:"TransactionHash,omitempty"` + Signatures map[string][]byte `protobuf:"bytes,2,rep,name=Signatures,proto3" json:"Signatures,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SignatureInfo) Reset() { *m = SignatureInfo{} } +func (m *SignatureInfo) String() string { return proto.CompactTextString(m) } +func (*SignatureInfo) ProtoMessage() {} +func (*SignatureInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_136af44c597c17ae, []int{1} +} + +func (m *SignatureInfo) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SignatureInfo.Unmarshal(m, b) +} +func (m *SignatureInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SignatureInfo.Marshal(b, m, deterministic) +} +func (m *SignatureInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SignatureInfo.Merge(m, src) +} +func (m *SignatureInfo) XXX_Size() int { + return xxx_messageInfo_SignatureInfo.Size(m) +} +func (m *SignatureInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SignatureInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SignatureInfo proto.InternalMessageInfo + +func (m *SignatureInfo) GetTransactionHash() []byte { + if m != nil { + return m.TransactionHash + } + return nil +} + +func (m *SignatureInfo) GetSignatures() map[string][]byte { + if m != nil { + return m.Signatures + } + return nil +} + +func init() { + proto.RegisterType((*MultiSignatureInfo)(nil), "model.MultiSignatureInfo") + proto.RegisterType((*SignatureInfo)(nil), "model.SignatureInfo") + proto.RegisterMapType((map[string][]byte)(nil), "model.SignatureInfo.SignaturesEntry") +} + +func init() { proto.RegisterFile("model/multiSignature.proto", fileDescriptor_136af44c597c17ae) } + +var fileDescriptor_136af44c597c17ae = []byte{ + // 270 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x41, 0x4b, 0xc3, 0x30, + 0x14, 0xc7, 0x49, 0xcb, 0x84, 0x3e, 0x37, 0xa6, 0xc1, 0x43, 0x19, 0x1e, 0xca, 0xf0, 0x10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 0x04, 0x83, 0xaf, 0xb2, 0x69, 0xbb, 0xf1, 0x86, 0xbc, 0x2b, 0x6e, 0xa2, + 0x6b, 0x32, 0x3b, 0x7d, 0x63, 0x0b, 0xe5, 0x97, 0x6d, 0x95, 0x0b, 0xd4, 0xc5, 0x1a, 0xb1, 0x12, + 0xdd, 0x79, 0x2e, 0xd0, 0xca, 0x42, 0xa0, 0xd6, 0x68, 0x8a, 0xd0, 0x54, 0xb5, 0x17, 0xd6, 0x7e, + 0xf5, 0x13, 0x00, 0x00, 0xff, 0xff, 0xe7, 0xa0, 0xec, 0xdf, 0x94, 0x01, 0x00, 0x00, +} diff --git a/common/model/transaction.pb.go b/common/model/transaction.pb.go index 550644ffb..80519d09a 100644 --- a/common/model/transaction.pb.go +++ b/common/model/transaction.pb.go @@ -41,6 +41,8 @@ const ( TransactionType_RemoveAccountDatasetTransaction TransactionType = 259 // in bytes: []byte{4,0,0,0} TransactionType_ApprovalEscrowTransaction TransactionType = 4 + // in bytes: []byte{5,0,0,0} + TransactionType_MultiSignatureTransaction TransactionType = 5 ) var TransactionType_name = map[int32]string{ @@ -53,6 +55,7 @@ var TransactionType_name = map[int32]string{ 3: "SetupAccountDatasetTransaction", 259: "RemoveAccountDatasetTransaction", 4: "ApprovalEscrowTransaction", + 5: "MultiSignatureTransaction", } var TransactionType_value = map[string]int32{ @@ -65,6 +68,7 @@ var TransactionType_value = map[string]int32{ "SetupAccountDatasetTransaction": 3, "RemoveAccountDatasetTransaction": 259, "ApprovalEscrowTransaction": 4, + "MultiSignatureTransaction": 5, } func (x TransactionType) String() string { @@ -102,10 +106,11 @@ type Transaction struct { // *Transaction_SetupAccountDatasetTransactionBody // *Transaction_RemoveAccountDatasetTransactionBody // *Transaction_ApprovalEscrowTransactionBody + // *Transaction_MultiSignatureTransactionBody TransactionBody isTransaction_TransactionBody `protobuf_oneof:"TransactionBody"` - Signature []byte `protobuf:"bytes,23,opt,name=Signature,proto3" json:"Signature,omitempty"` + Signature []byte `protobuf:"bytes,24,opt,name=Signature,proto3" json:"Signature,omitempty"` // nullable - Escrow *Escrow `protobuf:"bytes,24,opt,name=Escrow,proto3" json:"Escrow,omitempty"` + Escrow *Escrow `protobuf:"bytes,25,opt,name=Escrow,proto3" json:"Escrow,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -267,6 +272,10 @@ type Transaction_ApprovalEscrowTransactionBody struct { ApprovalEscrowTransactionBody *ApprovalEscrowTransactionBody `protobuf:"bytes,22,opt,name=approvalEscrowTransactionBody,proto3,oneof"` } +type Transaction_MultiSignatureTransactionBody struct { + MultiSignatureTransactionBody *MultiSignatureTransactionBody `protobuf:"bytes,23,opt,name=multiSignatureTransactionBody,proto3,oneof"` +} + func (*Transaction_EmptyTransactionBody) isTransaction_TransactionBody() {} func (*Transaction_SendMoneyTransactionBody) isTransaction_TransactionBody() {} @@ -285,6 +294,8 @@ func (*Transaction_RemoveAccountDatasetTransactionBody) isTransaction_Transactio func (*Transaction_ApprovalEscrowTransactionBody) isTransaction_TransactionBody() {} +func (*Transaction_MultiSignatureTransactionBody) isTransaction_TransactionBody() {} + func (m *Transaction) GetTransactionBody() isTransaction_TransactionBody { if m != nil { return m.TransactionBody @@ -355,6 +366,13 @@ func (m *Transaction) GetApprovalEscrowTransactionBody() *ApprovalEscrowTransact return nil } +func (m *Transaction) GetMultiSignatureTransactionBody() *MultiSignatureTransactionBody { + if x, ok := m.GetTransactionBody().(*Transaction_MultiSignatureTransactionBody); ok { + return x.MultiSignatureTransactionBody + } + return nil +} + func (m *Transaction) GetSignature() []byte { if m != nil { return m.Signature @@ -381,6 +399,7 @@ func (*Transaction) XXX_OneofWrappers() []interface{} { (*Transaction_SetupAccountDatasetTransactionBody)(nil), (*Transaction_RemoveAccountDatasetTransactionBody)(nil), (*Transaction_ApprovalEscrowTransactionBody)(nil), + (*Transaction_MultiSignatureTransactionBody)(nil), } } @@ -869,6 +888,64 @@ func (m *ApprovalEscrowTransactionBody) GetTransactionID() int64 { return 0 } +type MultiSignatureTransactionBody struct { + // MultiSignatureInfo represent the information of the multisig-address + MultiSignatureInfo *MultiSignatureInfo `protobuf:"bytes,1,opt,name=MultiSignatureInfo,proto3" json:"MultiSignatureInfo,omitempty"` + // Unsigned transaction bytes that will be executed once the transaction is valid + UnsignedTransactionBytes []byte `protobuf:"bytes,2,opt,name=UnsignedTransactionBytes,proto3" json:"UnsignedTransactionBytes,omitempty"` + // List of participantAddress-participantSignature with its tx hash + SignatureInfo *SignatureInfo `protobuf:"bytes,3,opt,name=SignatureInfo,proto3" json:"SignatureInfo,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *MultiSignatureTransactionBody) Reset() { *m = MultiSignatureTransactionBody{} } +func (m *MultiSignatureTransactionBody) String() string { return proto.CompactTextString(m) } +func (*MultiSignatureTransactionBody) ProtoMessage() {} +func (*MultiSignatureTransactionBody) Descriptor() ([]byte, []int) { + return fileDescriptor_8333001f09b34082, []int{10} +} + +func (m *MultiSignatureTransactionBody) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_MultiSignatureTransactionBody.Unmarshal(m, b) +} +func (m *MultiSignatureTransactionBody) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_MultiSignatureTransactionBody.Marshal(b, m, deterministic) +} +func (m *MultiSignatureTransactionBody) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiSignatureTransactionBody.Merge(m, src) +} +func (m *MultiSignatureTransactionBody) XXX_Size() int { + return xxx_messageInfo_MultiSignatureTransactionBody.Size(m) +} +func (m *MultiSignatureTransactionBody) XXX_DiscardUnknown() { + xxx_messageInfo_MultiSignatureTransactionBody.DiscardUnknown(m) +} + +var xxx_messageInfo_MultiSignatureTransactionBody proto.InternalMessageInfo + +func (m *MultiSignatureTransactionBody) GetMultiSignatureInfo() *MultiSignatureInfo { + if m != nil { + return m.MultiSignatureInfo + } + return nil +} + +func (m *MultiSignatureTransactionBody) GetUnsignedTransactionBytes() []byte { + if m != nil { + return m.UnsignedTransactionBytes + } + return nil +} + +func (m *MultiSignatureTransactionBody) GetSignatureInfo() *SignatureInfo { + if m != nil { + return m.SignatureInfo + } + return nil +} + // GetTransactionRequest return model.Transaction type GetTransactionRequest struct { // Fetch Transaction by its ID @@ -882,7 +959,7 @@ func (m *GetTransactionRequest) Reset() { *m = GetTransactionRequest{} } func (m *GetTransactionRequest) String() string { return proto.CompactTextString(m) } func (*GetTransactionRequest) ProtoMessage() {} func (*GetTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{10} + return fileDescriptor_8333001f09b34082, []int{11} } func (m *GetTransactionRequest) XXX_Unmarshal(b []byte) error { @@ -927,7 +1004,7 @@ func (m *GetTransactionsRequest) Reset() { *m = GetTransactionsRequest{} func (m *GetTransactionsRequest) String() string { return proto.CompactTextString(m) } func (*GetTransactionsRequest) ProtoMessage() {} func (*GetTransactionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{11} + return fileDescriptor_8333001f09b34082, []int{12} } func (m *GetTransactionsRequest) XXX_Unmarshal(b []byte) error { @@ -1004,7 +1081,7 @@ func (m *GetTransactionsResponse) Reset() { *m = GetTransactionsResponse func (m *GetTransactionsResponse) String() string { return proto.CompactTextString(m) } func (*GetTransactionsResponse) ProtoMessage() {} func (*GetTransactionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{12} + return fileDescriptor_8333001f09b34082, []int{13} } func (m *GetTransactionsResponse) XXX_Unmarshal(b []byte) error { @@ -1052,7 +1129,7 @@ func (m *PostTransactionRequest) Reset() { *m = PostTransactionRequest{} func (m *PostTransactionRequest) String() string { return proto.CompactTextString(m) } func (*PostTransactionRequest) ProtoMessage() {} func (*PostTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{13} + return fileDescriptor_8333001f09b34082, []int{14} } func (m *PostTransactionRequest) XXX_Unmarshal(b []byte) error { @@ -1091,7 +1168,7 @@ func (m *PostTransactionResponse) Reset() { *m = PostTransactionResponse func (m *PostTransactionResponse) String() string { return proto.CompactTextString(m) } func (*PostTransactionResponse) ProtoMessage() {} func (*PostTransactionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{14} + return fileDescriptor_8333001f09b34082, []int{15} } func (m *PostTransactionResponse) XXX_Unmarshal(b []byte) error { @@ -1133,7 +1210,7 @@ func (m *SendTransactionRequest) Reset() { *m = SendTransactionRequest{} func (m *SendTransactionRequest) String() string { return proto.CompactTextString(m) } func (*SendTransactionRequest) ProtoMessage() {} func (*SendTransactionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{15} + return fileDescriptor_8333001f09b34082, []int{16} } func (m *SendTransactionRequest) XXX_Unmarshal(b []byte) error { @@ -1187,7 +1264,7 @@ func (m *SendTransactionResponse) Reset() { *m = SendTransactionResponse func (m *SendTransactionResponse) String() string { return proto.CompactTextString(m) } func (*SendTransactionResponse) ProtoMessage() {} func (*SendTransactionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{16} + return fileDescriptor_8333001f09b34082, []int{17} } func (m *SendTransactionResponse) XXX_Unmarshal(b []byte) error { @@ -1229,7 +1306,7 @@ func (m *RequestBlockTransactionsRequest) Reset() { *m = RequestBlockTra func (m *RequestBlockTransactionsRequest) String() string { return proto.CompactTextString(m) } func (*RequestBlockTransactionsRequest) ProtoMessage() {} func (*RequestBlockTransactionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{17} + return fileDescriptor_8333001f09b34082, []int{18} } func (m *RequestBlockTransactionsRequest) XXX_Unmarshal(b []byte) error { @@ -1285,7 +1362,7 @@ func (m *SendBlockTransactionsRequest) Reset() { *m = SendBlockTransacti func (m *SendBlockTransactionsRequest) String() string { return proto.CompactTextString(m) } func (*SendBlockTransactionsRequest) ProtoMessage() {} func (*SendBlockTransactionsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{18} + return fileDescriptor_8333001f09b34082, []int{19} } func (m *SendBlockTransactionsRequest) XXX_Unmarshal(b []byte) error { @@ -1339,7 +1416,7 @@ func (m *SendBlockTransactionsResponse) Reset() { *m = SendBlockTransact func (m *SendBlockTransactionsResponse) String() string { return proto.CompactTextString(m) } func (*SendBlockTransactionsResponse) ProtoMessage() {} func (*SendBlockTransactionsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{19} + return fileDescriptor_8333001f09b34082, []int{20} } func (m *SendBlockTransactionsResponse) XXX_Unmarshal(b []byte) error { @@ -1379,7 +1456,7 @@ func (m *GetTransactionMinimumFeeRequest) Reset() { *m = GetTransactionM func (m *GetTransactionMinimumFeeRequest) String() string { return proto.CompactTextString(m) } func (*GetTransactionMinimumFeeRequest) ProtoMessage() {} func (*GetTransactionMinimumFeeRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{20} + return fileDescriptor_8333001f09b34082, []int{21} } func (m *GetTransactionMinimumFeeRequest) XXX_Unmarshal(b []byte) error { @@ -1419,7 +1496,7 @@ func (m *GetTransactionMinimumFeeResponse) Reset() { *m = GetTransaction func (m *GetTransactionMinimumFeeResponse) String() string { return proto.CompactTextString(m) } func (*GetTransactionMinimumFeeResponse) ProtoMessage() {} func (*GetTransactionMinimumFeeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_8333001f09b34082, []int{21} + return fileDescriptor_8333001f09b34082, []int{22} } func (m *GetTransactionMinimumFeeResponse) XXX_Unmarshal(b []byte) error { @@ -1459,6 +1536,7 @@ func init() { proto.RegisterType((*SetupAccountDatasetTransactionBody)(nil), "model.SetupAccountDatasetTransactionBody") proto.RegisterType((*RemoveAccountDatasetTransactionBody)(nil), "model.RemoveAccountDatasetTransactionBody") proto.RegisterType((*ApprovalEscrowTransactionBody)(nil), "model.ApprovalEscrowTransactionBody") + proto.RegisterType((*MultiSignatureTransactionBody)(nil), "model.MultiSignatureTransactionBody") proto.RegisterType((*GetTransactionRequest)(nil), "model.GetTransactionRequest") proto.RegisterType((*GetTransactionsRequest)(nil), "model.GetTransactionsRequest") proto.RegisterType((*GetTransactionsResponse)(nil), "model.GetTransactionsResponse") @@ -1476,90 +1554,96 @@ func init() { func init() { proto.RegisterFile("model/transaction.proto", fileDescriptor_8333001f09b34082) } var fileDescriptor_8333001f09b34082 = []byte{ - // 1351 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x73, 0xdb, 0x44, - 0x14, 0xb7, 0xe4, 0x38, 0x4d, 0x5e, 0x9c, 0x54, 0xd9, 0x26, 0xf6, 0x92, 0x26, 0x8d, 0x51, 0x93, - 0x8c, 0x49, 0xdb, 0x84, 0x86, 0x4c, 0x81, 0x63, 0xdc, 0xb4, 0x38, 0x43, 0x43, 0xc3, 0x26, 0xf4, - 0xd0, 0x19, 0x0e, 0x8a, 0xbc, 0x8d, 0x35, 0xb5, 0xb4, 0x42, 0x5a, 0xb7, 0x84, 0x32, 0xcc, 0x10, - 0xe0, 0xc0, 0x0c, 0x47, 0x3e, 0x11, 0x33, 0x7c, 0x0b, 0x8e, 0x7c, 0x0c, 0x86, 0x61, 0xb4, 0x2b, - 0xcb, 0x92, 0x2c, 0x5b, 0xa2, 0x5c, 0xb8, 0x78, 0x46, 0xef, 0xbd, 0xfd, 0xbd, 0x3f, 0xfb, 0xf6, - 0xed, 0x6f, 0x0d, 0x75, 0x9b, 0x75, 0x68, 0x6f, 0x97, 0x7b, 0x86, 0xe3, 0x1b, 0x26, 0xb7, 0x98, - 0xb3, 0xe3, 0x7a, 0x8c, 0x33, 0x54, 0x11, 0x8a, 0x95, 0x55, 0xa9, 0x77, 0x3d, 0xc6, 0x5e, 0x3c, - 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 0xca, 0x0d, 0x03, 0x25, 0xc2, - 0x20, 0x45, 0xd6, 0x04, 0x61, 0x14, 0x02, 0x47, 0xdf, 0x2b, 0xb0, 0x61, 0xf6, 0x0c, 0xcb, 0xce, - 0x8b, 0xe2, 0x86, 0x88, 0xe2, 0x4e, 0x18, 0xc5, 0xc3, 0x02, 0x4b, 0xda, 0x25, 0x52, 0x08, 0x1a, - 0xbd, 0x01, 0xdd, 0xa7, 0xbc, 0xef, 0x86, 0x07, 0xfe, 0xd0, 0xe0, 0x86, 0x4f, 0x79, 0x3a, 0x80, - 0x25, 0x11, 0xc0, 0x7b, 0x51, 0xbb, 0xe5, 0x2d, 0x68, 0x97, 0x48, 0x01, 0x58, 0xf4, 0x1d, 0xdc, - 0x96, 0x95, 0x9a, 0xec, 0x7d, 0x59, 0x78, 0xdf, 0x4e, 0x6c, 0x42, 0x9e, 0xfb, 0x22, 0xc0, 0xa8, - 0x07, 0x6b, 0x86, 0xeb, 0x7a, 0xec, 0x95, 0xd1, 0x7b, 0x24, 0x06, 0x7a, 0xda, 0x73, 0x4d, 0x78, - 0xde, 0x08, 0x3d, 0x1f, 0x4c, 0xb2, 0x6d, 0x97, 0xc8, 0x64, 0x30, 0xb4, 0x0a, 0xb3, 0xa7, 0xd6, - 0x85, 0x63, 0xf0, 0xbe, 0x47, 0x71, 0x5d, 0xcc, 0x9d, 0xa1, 0x00, 0x6d, 0xc2, 0xb4, 0x5c, 0x86, - 0xb1, 0x70, 0x3a, 0x3f, 0x18, 0x19, 0x42, 0x48, 0x42, 0x65, 0x6b, 0x31, 0x31, 0x27, 0x03, 0x5c, - 0xbd, 0x06, 0x4b, 0x59, 0x73, 0x45, 0x7f, 0x00, 0x78, 0xdc, 0x60, 0x40, 0x2b, 0x30, 0x7d, 0x60, - 0x07, 0x95, 0x11, 0x37, 0x94, 0x9c, 0xc6, 0xa1, 0x44, 0xff, 0x5b, 0x81, 0xf5, 0xbc, 0xb6, 0xd9, - 0x80, 0xf9, 0xc0,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x2b, 0x7d, 0xfb, 0x37, 0x15, 0x32, 0xde, 0xf3, 0x5a, - 0x9a, 0x5c, 0x6a, 0x25, 0x84, 0xe5, 0xbf, 0x0f, 0x69, 0x6a, 0xa9, 0x29, 0x68, 0x1d, 0x6e, 0x4e, - 0x20, 0x02, 0x9a, 0x8a, 0xb6, 0xe0, 0xdd, 0x5c, 0x6e, 0xa5, 0x5d, 0x09, 0xbb, 0x5c, 0x96, 0xa2, - 0x5d, 0x4d, 0xa1, 0x4d, 0x68, 0xe4, 0xd1, 0x0f, 0xed, 0x6a, 0x1a, 0xe9, 0x70, 0x6b, 0x32, 0x4f, - 0xd0, 0xca, 0x68, 0x23, 0x68, 0xff, 0x89, 0x97, 0xac, 0xf6, 0x83, 0x8a, 0xd6, 0xe0, 0x9d, 0xb1, - 0x77, 0x98, 0x36, 0xd5, 0xda, 0x7e, 0xde, 0xbc, 0xb0, 0x78, 0xb7, 0x7f, 0xbe, 0x63, 0x32, 0x7b, - 0xf7, 0x1b, 0xc6, 0xce, 0x4d, 0xf9, 0x7b, 0xcf, 0x64, 0x1e, 0xdd, 0x35, 0x99, 0x6d, 0x33, 0x67, - 0x57, 0x74, 0xc4, 0xf9, 0xb4, 0xf8, 0xff, 0xe8, 0x83, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd7, - 0x0f, 0x82, 0x8e, 0xe3, 0x12, 0x00, 0x00, + // 1449 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4f, 0x6f, 0xdb, 0xc6, + 0x12, 0x17, 0x29, 0xcb, 0xb1, 0x47, 0x92, 0x23, 0x6f, 0x64, 0x89, 0x71, 0xec, 0x58, 0x8f, 0xb1, + 0x0d, 0x3d, 0x27, 0xb1, 0x5f, 0xfc, 0x82, 0x34, 0xcd, 0xcd, 0x8a, 0x93, 0xca, 0x68, 0xdc, 0xb8, + 0x6b, 0x27, 0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, 0xa4, 0x05, + 0x8f, 0x3a, 0xd1, 0x1e, 0xba, 0xa2, 0xa0, 0x0d, 0xb8, 0x96, 0xd0, 0xf1, 0x54, 0x54, 0xb4, 0x0d, + 0xff, 0x49, 0x6d, 0x22, 0x2b, 0xef, 0xb8, 0x5e, 0x6a, 0x3b, 0x56, 0x79, 0x37, 0x87, 0xb6, 0xa0, + 0x91, 0xd6, 0x67, 0x55, 0xde, 0xcd, 0x23, 0x1d, 0xae, 0x27, 0x37, 0x44, 0x95, 0x3c, 0xda, 0xf4, + 0x3f, 0x81, 0xc4, 0x6e, 0xa2, 0xf2, 0xad, 0x8a, 0xd6, 0xe1, 0xea, 0xcc, 0xcb, 0xba, 0x32, 0xe7, + 0xc3, 0x33, 0x2f, 0xd3, 0x4a, 0xa1, 0xb5, 0xf3, 0xa2, 0xd9, 0xb5, 0x58, 0x6f, 0x78, 0xbe, 0x6b, + 0xd2, 0xc1, 0xde, 0x97, 0x94, 0x9e, 0x9b, 0xc1, 0xef, 0x6d, 0x93, 0xba, 0x64, 0xcf, 0xa4, 0x83, + 0x01, 0xb5, 0xf7, 0x78, 0xd1, 0x9c, 0xcf, 0xf3, 0x57, 0xbb, 0xff, 0xff, 0x15, 0x00, 0x00, 0xff, + 0xff, 0x5e, 0x24, 0x3a, 0xdd, 0x75, 0x14, 0x00, 0x00, } diff --git a/common/model/transactionBody.go b/common/model/transactionBody.go index 6296e9081..b92efaed5 100644 --- a/common/model/transactionBody.go +++ b/common/model/transactionBody.go @@ -12,3 +12,4 @@ func (*SendMoneyTransactionBody) isTransaction_TransactionBody() {} func (*SetupAccountDatasetTransactionBody) isTransaction_TransactionBody() {} func (*RemoveAccountDatasetTransactionBody) isTransaction_TransactionBody() {} func (*ApprovalEscrowTransactionBody) isTransaction_TransactionBody() {} +func (*MultiSignatureTransactionBody) isTransaction_TransactionBody() {} diff --git a/common/schema b/common/schema index 3e3f05b18..1977851c3 160000 --- a/common/schema +++ b/common/schema @@ -1 +1 @@ -Subproject commit 3e3f05b18b0d966dddb2ec3a7854e17f530f27c0 +Subproject commit 1977851c3802e00e9c6db6dd43e4be90cd1d5233 diff --git a/common/transaction/multiSignature.go b/common/transaction/multiSignature.go new file mode 100644 index 000000000..1d65c22ba --- /dev/null +++ b/common/transaction/multiSignature.go @@ -0,0 +1,202 @@ +package transaction + +import ( + "bytes" + + "github.com/zoobc/zoobc-core/common/constant" + "github.com/zoobc/zoobc-core/common/fee" + "github.com/zoobc/zoobc-core/common/model" + "github.com/zoobc/zoobc-core/common/util" +) + +type ( + // MultiSignatureTransaction represent wrapper transaction type that require multiple signer to approve the transcaction + // wrapped + MultiSignatureTransaction struct { + Body *model.MultiSignatureTransactionBody + NormalFee fee.FeeModelInterface + } +) + +func (*MultiSignatureTransaction) ApplyConfirmed(blockTimestamp int64) error { + return nil +} + +func (*MultiSignatureTransaction) ApplyUnconfirmed() error { + return nil +} + +func (*MultiSignatureTransaction) UndoApplyUnconfirmed() error { + return nil +} + +// Validate dbTx specify whether validation should read from transaction state or db state +func (*MultiSignatureTransaction) Validate(dbTx bool) error { + return nil +} + +func (tx *MultiSignatureTransaction) GetMinimumFee() (int64, error) { + minFee, err := tx.NormalFee.CalculateTxMinimumFee(tx.Body, nil) + if err != nil { + return 0, err + } + return minFee, err +} + +func (*MultiSignatureTransaction) GetAmount() int64 { + return 0 +} + +func (tx *MultiSignatureTransaction) GetSize() uint32 { + var ( + txByteSize, signaturesSize, multisigInfoSize uint32 + ) + // MultisigInfo + multisigInfo := tx.Body.GetMultiSignatureInfo() + multisigInfoSize += constant.MultisigFieldLength + if multisigInfo != nil { + multisigInfoSize += constant.MultiSigInfoMinSignature + multisigInfoSize += constant.MultiSigInfoNonce + multisigInfoSize += constant.MultiSigNumberOfAddress + for _, v := range multisigInfo.GetAddresses() { + multisigInfoSize += constant.MultiSigAddressLength + multisigInfoSize += uint32(len([]byte(v))) + } + } + // TransactionBytes + txByteSize = constant.MultiSigUnsignedTxBytesLength + uint32(len(tx.Body.GetUnsignedTransactionBytes())) + // SignatureInfo + signaturesSize += constant.MultisigFieldLength + if tx.Body.GetSignatureInfo() != nil { + signaturesSize += constant.MultiSigTransactionHash + signaturesSize += constant.MultiSigNumberOfSignatures + for address, sig := range tx.Body.SignatureInfo.Signatures { + signaturesSize += constant.MultiSigSignatureAddressLength + signaturesSize += uint32(len([]byte(address))) + signaturesSize += constant.MultiSigSignatureLength + signaturesSize += uint32(len(sig)) + } + } + + return txByteSize + signaturesSize + multisigInfoSize +} + +func (tx *MultiSignatureTransaction) ParseBodyBytes(txBodyBytes []byte) (model.TransactionBodyInterface, error) { + var ( + addresses []string + signatures = make(map[string][]byte) + multisigInfo *model.MultiSignatureInfo + signatureInfo *model.SignatureInfo + ) + bufferBytes := bytes.NewBuffer(txBodyBytes) + // MultisigInfo + multisigInfoPresent := util.ConvertBytesToUint32(bufferBytes.Next(int(constant.MultisigFieldLength))) + if multisigInfoPresent == constant.MultiSigFieldPresent { + minSignatures := util.ConvertBytesToUint32(bufferBytes.Next(int(constant.MultiSigInfoMinSignature))) + nonce := util.ConvertBytesToUint64(bufferBytes.Next(int(constant.MultiSigInfoNonce))) + addressesLength := util.ConvertBytesToUint32(bufferBytes.Next(int(constant.MultiSigNumberOfAddress))) + for i := 0; i < int(addressesLength); i++ { + addressLength := util.ConvertBytesToUint32(bufferBytes.Next(int(constant.MultiSigAddressLength))) + address, err := util.ReadTransactionBytes(bufferBytes, int(addressLength)) + if err != nil { + return nil, err + } + addresses = append(addresses, string(address)) + } + multisigInfo = &model.MultiSignatureInfo{ + MinimumSignatures: minSignatures, + Nonce: int64(nonce), + Addresses: addresses, + } + } + // TransactionBytes + unsignedTxLength := util.ConvertBytesToUint32(bufferBytes.Next(int(constant.MultiSigUnsignedTxBytesLength))) + unsignedTx, err := util.ReadTransactionBytes(bufferBytes, int(unsignedTxLength)) + if err != nil { + return nil, err + } + // SignatureInfo + signatureInfoPresent := util.ConvertBytesToUint32(bufferBytes.Next(int(constant.MultisigFieldLength))) + if signatureInfoPresent == constant.MultiSigFieldPresent { + transactionHash, err := util.ReadTransactionBytes(bufferBytes, int(constant.MultiSigTransactionHash)) + if err != nil { + return nil, err + } + signaturesLength := util.ConvertBytesToUint32(bufferBytes.Next(int(constant.MultiSigNumberOfSignatures))) + for i := 0; i < int(signaturesLength); i++ { + addressLength := util.ConvertBytesToUint32(bufferBytes.Next(int(constant.MultiSigAddressLength))) + address, err := util.ReadTransactionBytes(bufferBytes, int(addressLength)) + if err != nil { + return nil, err + } + signatureLength := util.ConvertBytesToUint32(bufferBytes.Next(int(constant.MultiSigSignatureLength))) + signature, err := util.ReadTransactionBytes(bufferBytes, int(signatureLength)) + if err != nil { + return nil, err + } + signatures[string(address)] = signature + } + signatureInfo = &model.SignatureInfo{ + TransactionHash: transactionHash, + Signatures: signatures, + } + } + + return &model.MultiSignatureTransactionBody{ + MultiSignatureInfo: multisigInfo, + UnsignedTransactionBytes: unsignedTx, + SignatureInfo: signatureInfo, + }, nil +} + +func (tx *MultiSignatureTransaction) GetBodyBytes() []byte { + var ( + buffer = bytes.NewBuffer([]byte{}) + ) + // Multisig Info + if tx.Body.GetMultiSignatureInfo() != nil { + buffer.Write(util.ConvertUint32ToBytes(constant.MultiSigFieldPresent)) + buffer.Write(util.ConvertUint32ToBytes(tx.Body.GetMultiSignatureInfo().GetMinimumSignatures())) + buffer.Write(util.ConvertUint64ToBytes(uint64(tx.Body.GetMultiSignatureInfo().GetNonce()))) + buffer.Write(util.ConvertUint32ToBytes(uint32(len(tx.Body.GetMultiSignatureInfo().GetAddresses())))) + for _, v := range tx.Body.GetMultiSignatureInfo().GetAddresses() { + buffer.Write(util.ConvertUint32ToBytes(uint32(len([]byte(v))))) + buffer.Write([]byte(v)) + } + } else { + buffer.Write(util.ConvertUint32ToBytes(constant.MultiSigFieldMissing)) + } + // Transaction Bytes + buffer.Write(util.ConvertUint32ToBytes(uint32(len(tx.Body.GetUnsignedTransactionBytes())))) + buffer.Write(tx.Body.GetUnsignedTransactionBytes()) + // SignatureInfo + if tx.Body.GetSignatureInfo() != nil { + buffer.Write(util.ConvertUint32ToBytes(constant.MultiSigFieldPresent)) + buffer.Write(tx.Body.GetSignatureInfo().GetTransactionHash()) + buffer.Write(util.ConvertUint32ToBytes(uint32(len(tx.Body.GetSignatureInfo().GetSignatures())))) + for address, sig := range tx.Body.GetSignatureInfo().GetSignatures() { + buffer.Write(util.ConvertUint32ToBytes(uint32(len([]byte(address))))) + buffer.Write([]byte(address)) + buffer.Write(util.ConvertUint32ToBytes(uint32(len(sig)))) + buffer.Write(sig) + } + } else { + buffer.Write(util.ConvertUint32ToBytes(constant.MultiSigFieldMissing)) + } + + return buffer.Bytes() +} + +func (tx *MultiSignatureTransaction) GetTransactionBody(transaction *model.Transaction) { + transaction.TransactionBody = &model.Transaction_MultiSignatureTransactionBody{ + MultiSignatureTransactionBody: tx.Body, + } +} + +func (*MultiSignatureTransaction) SkipMempoolTransaction(selectedTransactions []*model.Transaction) (bool, error) { + return false, nil +} + +func (*MultiSignatureTransaction) Escrowable() (EscrowTypeAction, bool) { + return nil, false +} diff --git a/common/transaction/multiSignature_test.go b/common/transaction/multiSignature_test.go new file mode 100644 index 000000000..6fd7f4952 --- /dev/null +++ b/common/transaction/multiSignature_test.go @@ -0,0 +1,247 @@ +package transaction + +import ( + "math/rand" + "reflect" + "testing" + + "github.com/zoobc/zoobc-core/common/constant" + + "github.com/zoobc/zoobc-core/common/fee" + "github.com/zoobc/zoobc-core/common/model" +) + +func TestMultiSignatureTransaction_GetSize(t *testing.T) { + type fields struct { + Body *model.MultiSignatureTransactionBody + NormalFee fee.FeeModelInterface + } + tests := []struct { + name string + fields fields + want uint32 + }{ + { + name: "GetSize-Success-no_addresses-no_signatures-no_transactionBytes", + fields: fields{ + Body: &model.MultiSignatureTransactionBody{ + MultiSignatureInfo: &model.MultiSignatureInfo{ + MinimumSignatures: rand.Uint32(), + Nonce: rand.Int63(), + Addresses: nil, + }, + UnsignedTransactionBytes: nil, + SignatureInfo: nil, + }, + NormalFee: nil, + }, + want: constant.MultisigFieldLength + constant.MultiSigInfoMinSignature + constant.MultiSigInfoNonce + + constant.MultiSigNumberOfAddress + constant.MultiSigUnsignedTxBytesLength + constant.MultisigFieldLength, + }, + { + name: "GetSize-Success-with_addresses-no_signatures-no_transactionBytes", + fields: fields{ + Body: &model.MultiSignatureTransactionBody{ + MultiSignatureInfo: &model.MultiSignatureInfo{ + MinimumSignatures: rand.Uint32(), + Nonce: rand.Int63(), + Addresses: []string{ + "A", + }, + }, + UnsignedTransactionBytes: nil, + SignatureInfo: nil, + }, + NormalFee: nil, + }, + want: constant.MultisigFieldLength + constant.MultiSigInfoMinSignature + constant.MultiSigInfoNonce + + constant.MultiSigNumberOfAddress + constant.MultiSigUnsignedTxBytesLength + constant.MultisigFieldLength + + constant.MultiSigAddressLength + uint32(len([]byte("A"))), + }, + { + name: "GetSize-Success-with_addresses-with_signatures-no_transactionBytes", + fields: fields{ + Body: &model.MultiSignatureTransactionBody{ + MultiSignatureInfo: &model.MultiSignatureInfo{ + MinimumSignatures: rand.Uint32(), + Nonce: rand.Int63(), + Addresses: []string{ + "A", + }, + }, + UnsignedTransactionBytes: nil, + SignatureInfo: &model.SignatureInfo{ + TransactionHash: make([]byte, constant.MultiSigTransactionHash), + Signatures: map[string][]byte{ + "A": make([]byte, 64), + }, + }, + }, + NormalFee: nil, + }, + want: constant.MultisigFieldLength + constant.MultiSigInfoMinSignature + constant.MultiSigInfoNonce + + constant.MultiSigNumberOfAddress + constant.MultiSigAddressLength + uint32(len([]byte("A"))) + + constant.MultiSigUnsignedTxBytesLength + constant.MultisigFieldLength + constant.MultiSigTransactionHash + + constant.MultiSigNumberOfSignatures + constant.MultiSigAddressLength + uint32(len([]byte("A"))) + + constant.MultiSigSignatureLength + 64, + }, + { + name: "GetSize-Success-with_addresses-with_signatures-with_transactionBytes", + fields: fields{ + Body: &model.MultiSignatureTransactionBody{ + MultiSignatureInfo: &model.MultiSignatureInfo{ + MinimumSignatures: rand.Uint32(), + Nonce: rand.Int63(), + Addresses: []string{ + "A", + }, + }, + UnsignedTransactionBytes: make([]byte, 120), + SignatureInfo: &model.SignatureInfo{ + TransactionHash: make([]byte, constant.MultiSigTransactionHash), + Signatures: map[string][]byte{ + "A": make([]byte, 64), + }, + }, + }, + NormalFee: nil, + }, + want: constant.MultisigFieldLength + constant.MultiSigInfoMinSignature + constant.MultiSigInfoNonce + + constant.MultiSigNumberOfAddress + constant.MultiSigAddressLength + uint32(len([]byte("A"))) + + constant.MultisigFieldLength + constant.MultiSigTransactionHash + constant.MultiSigNumberOfSignatures + + constant.MultiSigAddressLength + uint32(len([]byte("A"))) + + constant.MultiSigSignatureLength + 64 + + constant.MultiSigUnsignedTxBytesLength + 120, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tx := &MultiSignatureTransaction{ + Body: tt.fields.Body, + NormalFee: tt.fields.NormalFee, + } + if got := tx.GetSize(); got != tt.want { + t.Errorf("GetSize() = %v, want %v", got, tt.want) + } + }) + } +} + +var ( + // mock for GetBodyBytes & ParseBodyBytes + mockMultipleSignatureBody = &model.MultiSignatureTransactionBody{ + MultiSignatureInfo: &model.MultiSignatureInfo{ + MinimumSignatures: 2, + Nonce: 1, + Addresses: []string{ + "A", + "B", + "C", + }, + }, + UnsignedTransactionBytes: make([]byte, 120), + SignatureInfo: &model.SignatureInfo{ + TransactionHash: make([]byte, constant.MultiSigTransactionHash), + Signatures: map[string][]byte{ + "A": make([]byte, 64), + }, + }, + } + mockMultipleSignatureBodyBytes = []byte{ + 1, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 65, 1, 0, 0, 0, 66, 1, 0, 0, 0, + 67, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 65, 64, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + } + // mock for GetBodyBytes & ParseBodyBytes +) + +func TestMultiSignatureTransaction_GetBodyBytes(t *testing.T) { + type fields struct { + Body *model.MultiSignatureTransactionBody + NormalFee fee.FeeModelInterface + } + tests := []struct { + name string + fields fields + want []byte + }{ + { + name: "GetBodyBytes-Success", + fields: fields{ + Body: nil, + NormalFee: nil, + }, + want: make([]byte, 12), + }, + { + name: "GetBodyBytes-Success-Complete", + fields: fields{ + Body: mockMultipleSignatureBody, + NormalFee: nil, + }, + want: mockMultipleSignatureBodyBytes, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tx := &MultiSignatureTransaction{ + Body: tt.fields.Body, + NormalFee: tt.fields.NormalFee, + } + if got := tx.GetBodyBytes(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetBodyBytes() = %v, want %v", got, tt.want) + } + }) + } +} + +func TestMultiSignatureTransaction_ParseBodyBytes(t *testing.T) { + type fields struct { + Body *model.MultiSignatureTransactionBody + NormalFee fee.FeeModelInterface + } + type args struct { + txBodyBytes []byte + } + tests := []struct { + name string + fields fields + args args + want model.TransactionBodyInterface + wantErr bool + }{ + { + name: "ParseBodyBytes-success", + fields: fields{ + Body: nil, + NormalFee: nil, + }, + args: args{ + txBodyBytes: mockMultipleSignatureBodyBytes, + }, + want: mockMultipleSignatureBody, + wantErr: false, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tx := &MultiSignatureTransaction{ + Body: tt.fields.Body, + NormalFee: tt.fields.NormalFee, + } + got, err := tx.ParseBodyBytes(tt.args.txBodyBytes) + if (err != nil) != tt.wantErr { + t.Errorf("ParseBodyBytes() error = %v, wantErr %v", err, tt.wantErr) + return + } + if !reflect.DeepEqual(got, tt.want) { + t.Errorf("ParseBodyBytes() got = %v, want %v", got, tt.want) + } + }) + } +} diff --git a/common/transaction/transaction.go b/common/transaction/transaction.go index 3d6339847..e9bc05010 100644 --- a/common/transaction/transaction.go +++ b/common/transaction/transaction.go @@ -224,7 +224,20 @@ func (ts *TypeSwitcher) GetTransactionType(tx *model.Transaction) (TypeAction, e default: return nil, nil } - + case 5: + switch buf[1] { + case 0: + multiSigTransactionBody, err := new(MultiSignatureTransaction).ParseBodyBytes(tx.GetTransactionBodyBytes()) + if err != nil { + return nil, err + } + return &MultiSignatureTransaction{ + Body: multiSigTransactionBody.(*model.MultiSignatureTransactionBody), + NormalFee: fee.NewConstantFeeModel(constant.OneZBC / 100), + }, nil + default: + return nil, nil + } default: return nil, nil } diff --git a/common/transaction/transactionGeneral.go b/common/transaction/transactionGeneral.go index c813b04c9..0184495d9 100644 --- a/common/transaction/transactionGeneral.go +++ b/common/transaction/transactionGeneral.go @@ -147,7 +147,6 @@ func (tu *Util) ParseTransactionBytes(transactionBytes []byte, sign bool) (*mode return nil, err } transaction.TransactionBodyLength = util.ConvertBytesToUint32(chunkedBytes) - transaction.TransactionBodyBytes, err = util.ReadTransactionBytes(buffer, int(transaction.TransactionBodyLength)) if err != nil { return nil, err