From c3ad6dab6255489a4b4bfa86a973682263d8f395 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 18 Oct 2023 18:38:31 +0100 Subject: [PATCH] rename RentStructure() to StorageScoreStructure() --- pkg/protocol/engine/accounts/mana/manager.go | 4 ++-- pkg/protocol/snapshotcreator/snapshotcreator.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/protocol/engine/accounts/mana/manager.go b/pkg/protocol/engine/accounts/mana/manager.go index 726cc6996..e28cffd74 100644 --- a/pkg/protocol/engine/accounts/mana/manager.go +++ b/pkg/protocol/engine/accounts/mana/manager.go @@ -51,7 +51,7 @@ func (m *Manager) GetManaOnAccount(accountID iotago.AccountID, currentSlot iotag if err != nil { return 0, ierrors.Errorf("failed to resolve AccountOutput for %s in slot %s: %w", accountID, currentSlot, err) } - minDeposit, err := m.apiProvider.CurrentAPI().RentStructure().MinDeposit(output.Output()) + minDeposit, err := m.apiProvider.CurrentAPI().StorageScoreStructure().MinDeposit(output.Output()) if err != nil { return 0, ierrors.Errorf("failed to get min deposit for %s: %w", accountID, err) } @@ -127,7 +127,7 @@ func (m *Manager) ApplyDiff(slot iotago.SlotIndex, destroyedAccounts ds.Set[iota var storedMana iotago.Mana var err error if output, has := accountOutputs[accountID]; has { - minDeposit := lo.PanicOnErr(m.apiProvider.CurrentAPI().RentStructure().MinDeposit(output.Output())) + minDeposit := lo.PanicOnErr(m.apiProvider.CurrentAPI().StorageScoreStructure().MinDeposit(output.Output())) excessBaseTokens, err = safemath.SafeSub(output.BaseTokenAmount(), minDeposit) if err != nil { excessBaseTokens = 0 diff --git a/pkg/protocol/snapshotcreator/snapshotcreator.go b/pkg/protocol/snapshotcreator/snapshotcreator.go index 0d4679f7f..4a61d1151 100644 --- a/pkg/protocol/snapshotcreator/snapshotcreator.go +++ b/pkg/protocol/snapshotcreator/snapshotcreator.go @@ -174,7 +174,7 @@ func createGenesisOutput(genesisTokenAmount iotago.BaseToken, genesisSeed []byte genesisWallet := mock.NewHDWallet("genesis", genesisSeed, 0) output := createOutput(genesisWallet.Address(), genesisTokenAmount) - if _, err := engineInstance.CurrentAPI().RentStructure().CoversMinDeposit(output, genesisTokenAmount); err != nil { + if _, err := engineInstance.CurrentAPI().StorageScoreStructure().CoversMinDeposit(output, genesisTokenAmount); err != nil { return nil, ierrors.Wrap(err, "min rent not covered by Genesis output with index 0") } @@ -190,7 +190,7 @@ func createGenesisAccounts(accounts []AccountDetails, engineInstance *engine.Eng for idx, genesisAccount := range accounts { output := createAccount(genesisAccount.AccountID, genesisAccount.Address, genesisAccount.Amount, genesisAccount.Mana, genesisAccount.IssuerKey, genesisAccount.ExpirySlot, genesisAccount.StakedAmount, genesisAccount.StakingEpochEnd, genesisAccount.FixedCost) - if _, err := engineInstance.CurrentAPI().RentStructure().CoversMinDeposit(output, genesisAccount.Amount); err != nil { + if _, err := engineInstance.CurrentAPI().StorageScoreStructure().CoversMinDeposit(output, genesisAccount.Amount); err != nil { return nil, ierrors.Wrapf(err, "min rent not covered by account output with index %d", idx+1) }