core: unexport native Management's GetMinimumDeploymentFee

This method is used only from Management contract. We also have
neotest-based tests for `getMinimumDeploymentFee`, it should be enough.
This commit is contained in:
Anna Shaleva 2022-03-11 11:34:37 +03:00
parent bedfd75086
commit 150041d25e
2 changed files with 4 additions and 13 deletions

View file

@ -200,7 +200,7 @@ func (m *Management) getNefAndManifestFromItems(ic *interop.Context, args []stac
gas := ic.Chain.GetStoragePrice() * int64(len(nefBytes)+len(manifestBytes))
if isDeploy {
fee := m.GetMinimumDeploymentFee(ic.DAO)
fee := m.minimumDeploymentFee(ic.DAO)
if fee > gas {
gas = fee
}
@ -400,11 +400,11 @@ func (m *Management) Destroy(d *dao.Simple, hash util.Uint160) error {
}
func (m *Management) getMinimumDeploymentFee(ic *interop.Context, args []stackitem.Item) stackitem.Item {
return stackitem.NewBigInteger(big.NewInt(m.GetMinimumDeploymentFee(ic.DAO)))
return stackitem.NewBigInteger(big.NewInt(m.minimumDeploymentFee(ic.DAO)))
}
// GetMinimumDeploymentFee returns the minimum required fee for contract deploy.
func (m *Management) GetMinimumDeploymentFee(dao *dao.Simple) int64 {
// minimumDeploymentFee returns the minimum required fee for contract deploy.
func (m *Management) minimumDeploymentFee(dao *dao.Simple) int64 {
return getIntWithKey(m.ID, dao, keyMinimumDeploymentFee)
}

View file

@ -14,15 +14,6 @@ type memoryStore struct {
func (memoryStore) Close() error { return nil }
func TestMinimumDeploymentFee(t *testing.T) {
chain := newTestChain(t)
t.Run("get, internal method", func(t *testing.T) {
n := chain.contracts.Management.GetMinimumDeploymentFee(chain.dao)
require.Equal(t, 10_00000000, int(n))
})
}
func TestManagement_GetNEP17Contracts(t *testing.T) {
t.Run("empty chain", func(t *testing.T) {
chain := newTestChain(t)