From bd80a56c0ea101907df3c45db913e5a24ab6398f Mon Sep 17 00:00:00 2001 From: Mikelle Date: Mon, 15 Apr 2024 15:17:14 +0200 Subject: [PATCH] added waitReceipt for OpenCommitment --- pkg/contracts/preconf/preconf.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/contracts/preconf/preconf.go b/pkg/contracts/preconf/preconf.go index dfdd9c7..2a2ae10 100644 --- a/pkg/contracts/preconf/preconf.go +++ b/pkg/contracts/preconf/preconf.go @@ -150,5 +150,12 @@ func (p *preconfContract) OpenCommitment( return common.Hash{}, err } + receipt, err := p.client.WaitForReceipt(ctx, txHash) + if err != nil { + return common.Hash{}, err // Updated to return common.Hash{} + } + + p.logger.Info("preconf contract openCommitment successful", "txHash", txHash, "receiptStatus", receipt.Status) + return txHash, nil }