Skip to content

Commit 3f3f5fe

Browse files
revert changes that arent needed
1 parent 69b98ee commit 3f3f5fe

3 files changed

Lines changed: 23 additions & 24 deletions

File tree

client/convert/protobuf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ func TransactionToMessage(t flow.Transaction) (*entities.Transaction, error) {
444444

445445
func MessageToTransaction(m *entities.Transaction) (flow.Transaction, error) {
446446
if m == nil {
447-
return *flow.NewTransaction(), ErrEmptyMessage
447+
return flow.Transaction{}, ErrEmptyMessage
448448
}
449449

450450
t := flow.NewTransaction()

transaction.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -420,19 +420,19 @@ func DecodeTransaction(transactionMessage []byte) (*Transaction, error) {
420420
for i, auth := range temp.Payload.Authorizers {
421421
authorizers[i] = BytesToAddress(auth)
422422
}
423-
t := NewTransaction()
424-
t.Script = temp.Payload.Script
425-
t.Arguments = temp.Payload.Arguments
426-
t.ReferenceBlockID = BytesToID(temp.Payload.ReferenceBlockID)
427-
t.GasLimit = temp.Payload.GasLimit
428-
t.ProposalKey = ProposalKey{
429-
Address: BytesToAddress(temp.Payload.ProposalKeyAddress),
430-
KeyIndex: int(temp.Payload.ProposalKeyIndex),
431-
SequenceNumber: temp.Payload.ProposalKeySequenceNumber,
432-
}
433-
t.Payer = BytesToAddress(temp.Payload.Payer)
434-
t.Authorizers = authorizers
435-
423+
t := &Transaction{
424+
Script: temp.Payload.Script,
425+
Arguments: temp.Payload.Arguments,
426+
ReferenceBlockID: BytesToID(temp.Payload.ReferenceBlockID),
427+
GasLimit: temp.Payload.GasLimit,
428+
ProposalKey: ProposalKey{
429+
Address: BytesToAddress(temp.Payload.ProposalKeyAddress),
430+
KeyIndex: int(temp.Payload.ProposalKeyIndex),
431+
SequenceNumber: temp.Payload.ProposalKeySequenceNumber,
432+
},
433+
Payer: BytesToAddress(temp.Payload.Payer),
434+
Authorizers: authorizers,
435+
}
436436
signers := t.signerList()
437437
if len(temp.PayloadSignatures) > 0 {
438438
payloadSignatures := make([]TransactionSignature, len(temp.PayloadSignatures))

transaction_test.go

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -561,16 +561,15 @@ func baseTx() *flow.Transaction {
561561
}
562562

563563
func copyTxPayload(tx *flow.Transaction) *flow.Transaction {
564-
t := flow.NewTransaction()
565-
t.Script = tx.Script
566-
t.Arguments = tx.Arguments
567-
t.ReferenceBlockID = tx.ReferenceBlockID
568-
t.GasLimit = tx.GasLimit
569-
t.ProposalKey = tx.ProposalKey
570-
t.Payer = tx.Payer
571-
t.Authorizers = tx.Authorizers
572-
573-
return t
564+
return &flow.Transaction{
565+
Script: tx.Script,
566+
Arguments: tx.Arguments,
567+
ReferenceBlockID: tx.ReferenceBlockID,
568+
GasLimit: tx.GasLimit,
569+
ProposalKey: tx.ProposalKey,
570+
Payer: tx.Payer,
571+
Authorizers: tx.Authorizers,
572+
}
574573
}
575574

576575
func copyTxEnvelope(tx *flow.Transaction) *flow.Transaction {

0 commit comments

Comments
 (0)