diff --git a/pkg/testsuite/accounts.go b/pkg/testsuite/accounts.go index 212a17899..80d2b659f 100644 --- a/pkg/testsuite/accounts.go +++ b/pkg/testsuite/accounts.go @@ -14,12 +14,13 @@ func (t *TestSuite) AssertAccountStake(accountID iotago.AccountID, validatorStak nodes ...*mock.Node) { for _, node := range nodes { t.Eventually(func() error { - actualAccountData, exists, err := node.Protocol.MainEngineInstance().Ledger.Account(accountID, node.Protocol.MainEngineInstance().SyncManager.LatestCommitment().Slot()) + + actualAccountData, exists, err := node.Protocol.Engines.Main.Get().Ledger.Account(accountID, node.Protocol.Engines.Main.Get().SyncManager.LatestCommitment().Slot()) if err != nil { return ierrors.Wrap(err, "AssertAccountData: failed to load account data") } if !exists { - return ierrors.Errorf("AssertAccountData: %s: account %s does not exist with latest committed slot %d", node.Name, accountID, node.Protocol.MainEngineInstance().SyncManager.LatestCommitment().Slot()) + return ierrors.Errorf("AssertAccountData: %s: account %s does not exist with latest committed slot %d", node.Name, accountID, node.Protocol.Engines.Main.Get().SyncManager.LatestCommitment().Slot()) } if accountID != actualAccountData.ID { diff --git a/pkg/testsuite/mock/wallet_transactions.go b/pkg/testsuite/mock/wallet_transactions.go index 76d48132d..911ba4622 100644 --- a/pkg/testsuite/mock/wallet_transactions.go +++ b/pkg/testsuite/mock/wallet_transactions.go @@ -101,7 +101,7 @@ func (w *Wallet) CreateDelegationFromInput(transactionName string, inputName str } func (w *Wallet) DelegationStartFromSlot(slot iotago.SlotIndex) iotago.EpochIndex { - latestCommitment := w.Node.Protocol.MainEngineInstance().Storage.Settings().LatestCommitment() + latestCommitment := w.Node.Protocol.Engines.Main.Get().Storage.Settings().LatestCommitment() apiForSlot := w.Node.Protocol.APIForSlot(slot) pastBoundedSlotIndex := latestCommitment.Slot() + apiForSlot.ProtocolParameters().MaxCommittableAge() @@ -117,7 +117,7 @@ func (w *Wallet) DelegationStartFromSlot(slot iotago.SlotIndex) iotago.EpochInde } func (w *Wallet) DelegationEndFromSlot(slot iotago.SlotIndex) iotago.EpochIndex { - latestCommitment := w.Node.Protocol.MainEngineInstance().Storage.Settings().LatestCommitment() + latestCommitment := w.Node.Protocol.Engines.Main.Get().Storage.Settings().LatestCommitment() apiForSlot := w.Node.Protocol.APIForSlot(slot) futureBoundedSlotIndex := latestCommitment.Slot() + apiForSlot.ProtocolParameters().MinCommittableAge()