From 4d0592d444b9b1386a22300db4e14a9f82172a3a Mon Sep 17 00:00:00 2001 From: Alexander Sporn Date: Mon, 13 Nov 2023 13:02:32 +0100 Subject: [PATCH] Fixed the genesis ledger having the outputs always booked at slot 0 instead of the genesis slot --- pkg/testsuite/snapshotcreator/snapshotcreator.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkg/testsuite/snapshotcreator/snapshotcreator.go b/pkg/testsuite/snapshotcreator/snapshotcreator.go index 597923332..afbc29494 100644 --- a/pkg/testsuite/snapshotcreator/snapshotcreator.go +++ b/pkg/testsuite/snapshotcreator/snapshotcreator.go @@ -43,10 +43,6 @@ import ( // | node1 | node1 | // | node2 | node2 |. -const ( - GenesisTransactionCreationSlot = 0 -) - var GenesisTransactionCommitment = iotago.IdentifierFromData([]byte("genesis")) func CreateSnapshot(opts ...options.Option[Options]) error { @@ -160,7 +156,7 @@ func CreateSnapshot(opts ...options.Option[Options]) error { var accountLedgerOutputs utxoledger.Outputs for idx, output := range genesisTransactionOutputs { - proof, err := iotago.NewOutputIDProof(engineInstance.LatestAPI(), GenesisTransactionCommitment, GenesisTransactionCreationSlot, genesisTransactionOutputs, uint16(idx)) + proof, err := iotago.NewOutputIDProof(engineInstance.LatestAPI(), GenesisTransactionCommitment, api.ProtocolParameters().GenesisSlot(), genesisTransactionOutputs, uint16(idx)) if err != nil { return err } @@ -171,7 +167,7 @@ func CreateSnapshot(opts ...options.Option[Options]) error { return err } - utxoOutput := utxoledger.CreateOutput(engineInstance, outputID, api.ProtocolParameters().GenesisBlockID(), GenesisTransactionCreationSlot, output, proof) + utxoOutput := utxoledger.CreateOutput(engineInstance, outputID, api.ProtocolParameters().GenesisBlockID(), api.ProtocolParameters().GenesisSlot(), output, proof) if err := engineInstance.Ledger.AddGenesisUnspentOutput(utxoOutput); err != nil { return err }