diff --git a/pkg/testsuite/mock/blockissuer.go b/pkg/testsuite/mock/blockissuer.go index d8e1498f0..8b1e280fe 100644 --- a/pkg/testsuite/mock/blockissuer.go +++ b/pkg/testsuite/mock/blockissuer.go @@ -94,6 +94,9 @@ func (i *BlockIssuer) Address() iotago.Address { func (i *BlockIssuer) CreateValidationBlock(ctx context.Context, alias string, node *Node, opts ...options.Option[ValidationBlockParams]) (*blocks.Block, error) { blockParams := options.Apply(NewValidationBlockParams(), opts) + blockIssuanceInfo, err := i.Client.BlockIssuance(ctx) + require.NoError(i.Testing, err) + if blockParams.BlockHeader.IssuingTime == nil { issuingTime := time.Now().UTC() blockParams.BlockHeader.IssuingTime = &issuingTime @@ -101,8 +104,7 @@ func (i *BlockIssuer) CreateValidationBlock(ctx context.Context, alias string, n apiForBlock := i.retrieveAPI(blockParams.BlockHeader) protoParams := apiForBlock.ProtocolParameters() - blockIssuanceInfo, err := i.Client.BlockIssuance(ctx) - require.NoError(i.Testing, err) + if blockParams.BlockHeader.SlotCommitment == nil { commitment := blockIssuanceInfo.LatestCommitment blockSlot := apiForBlock.TimeProvider().SlotFromTime(*blockParams.BlockHeader.IssuingTime)