From 40172b2df1207507aff046931c44656809a44aca Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Thu, 27 Feb 2025 09:20:33 -0500 Subject: [PATCH] fix: remove copy loop var as it's no longer necessary Signed-off-by: Chris Gianelloni --- ledger/alonzo/alonzo.go | 2 +- ledger/babbage/babbage.go | 4 ++-- ledger/byron/byron.go | 4 ++-- ledger/mary/mary.go | 2 +- ledger/shelley/shelley.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ledger/alonzo/alonzo.go b/ledger/alonzo/alonzo.go index 450aa2a4..bd6f9b50 100644 --- a/ledger/alonzo/alonzo.go +++ b/ledger/alonzo/alonzo.go @@ -169,7 +169,7 @@ func (b *AlonzoTransactionBody) UnmarshalCBOR(cborData []byte) error { func (b *AlonzoTransactionBody) Outputs() []common.TransactionOutput { ret := []common.TransactionOutput{} for _, output := range b.TxOutputs { - output := output + ret = append(ret, &output) } return ret diff --git a/ledger/babbage/babbage.go b/ledger/babbage/babbage.go index c28e37a3..ea7bafa5 100644 --- a/ledger/babbage/babbage.go +++ b/ledger/babbage/babbage.go @@ -227,7 +227,7 @@ func (b *BabbageTransactionBody) UnmarshalCBOR(cborData []byte) error { func (b *BabbageTransactionBody) Outputs() []common.TransactionOutput { ret := []common.TransactionOutput{} for _, output := range b.TxOutputs { - output := output + ret = append(ret, &output) } return ret @@ -244,7 +244,7 @@ func (b *BabbageTransactionBody) ProtocolParameterUpdates() (uint64, map[common. func (b *BabbageTransactionBody) ReferenceInputs() []common.TransactionInput { ret := []common.TransactionInput{} for _, input := range b.TxReferenceInputs { - input := input + ret = append(ret, &input) } return ret diff --git a/ledger/byron/byron.go b/ledger/byron/byron.go index 7040c23a..68d58751 100644 --- a/ledger/byron/byron.go +++ b/ledger/byron/byron.go @@ -170,7 +170,7 @@ func (t *ByronTransaction) Inputs() []common.TransactionInput { func (t *ByronTransaction) Outputs() []common.TransactionOutput { ret := []common.TransactionOutput{} for _, output := range t.TxOutputs { - output := output + ret = append(ret, &output) } return ret @@ -617,7 +617,7 @@ func (b *ByronMainBlock) Era() common.Era { func (b *ByronMainBlock) Transactions() []common.Transaction { ret := make([]common.Transaction, len(b.Body.TxPayload)) for idx, payload := range b.Body.TxPayload { - payload := payload + ret[idx] = &payload.Transaction } return ret diff --git a/ledger/mary/mary.go b/ledger/mary/mary.go index 57fc6c14..452e54c5 100644 --- a/ledger/mary/mary.go +++ b/ledger/mary/mary.go @@ -159,7 +159,7 @@ func (b *MaryTransactionBody) UnmarshalCBOR(cborData []byte) error { func (b *MaryTransactionBody) Outputs() []common.TransactionOutput { ret := []common.TransactionOutput{} for _, output := range b.TxOutputs { - output := output + ret = append(ret, &output) } return ret diff --git a/ledger/shelley/shelley.go b/ledger/shelley/shelley.go index 5c90ba09..e693cad5 100644 --- a/ledger/shelley/shelley.go +++ b/ledger/shelley/shelley.go @@ -232,7 +232,7 @@ func (b *ShelleyTransactionBody) Inputs() []common.TransactionInput { func (b *ShelleyTransactionBody) Outputs() []common.TransactionOutput { ret := []common.TransactionOutput{} for _, output := range b.TxOutputs { - output := output + ret = append(ret, &output) } return ret