From 883ca073141baf6964a5cd5bcedef0bfa3fa6e42 Mon Sep 17 00:00:00 2001 From: Stefan Iliev <46542846+StefanIliev545@users.noreply.github.com> Date: Wed, 6 Nov 2024 19:38:23 +0200 Subject: [PATCH] Fix. (#2128) Co-authored-by: StefanIliev545 --- go/enclave/system/hooks.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/go/enclave/system/hooks.go b/go/enclave/system/hooks.go index c5c954f5c5..1c0512ac65 100644 --- a/go/enclave/system/hooks.go +++ b/go/enclave/system/hooks.go @@ -79,14 +79,14 @@ func (s *systemContractCallbacks) Load() error { return fmt.Errorf("failed fetching batch %w", err) } - if len(batch.Transactions) < 2 { + if len(batch.Transactions) < 1 { s.logger.Error("Load: Genesis batch does not have enough transactions", "batchSeqNo", batchSeqNo, "transactionCount", len(batch.Transactions)) return fmt.Errorf("genesis batch does not have enough transactions") } - receipt, err := s.storage.GetFilteredInternalReceipt(context.Background(), batch.Transactions[1].Hash(), nil, true) + receipt, err := s.storage.GetFilteredInternalReceipt(context.Background(), batch.Transactions[0].Hash(), nil, true) if err != nil { - s.logger.Error("Load: Failed fetching receipt", "transactionHash", batch.Transactions[1].Hash().Hex(), "error", err) + s.logger.Error("Load: Failed fetching receipt", "transactionHash", batch.Transactions[0].Hash().Hex(), "error", err) return fmt.Errorf("failed fetching receipt %w", err) }