Skip to content

Commit

Permalink
rename RentStructure() to StorageScoreStructure()
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberphysic4l committed Oct 18, 2023
1 parent 4113ec1 commit c3ad6da
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/protocol/engine/accounts/mana/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkg/protocol/snapshotcreator/snapshotcreator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

Expand All @@ -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)
}

Expand Down

0 comments on commit c3ad6da

Please sign in to comment.