From 150041d25e98c43a9844c34584a147895db848a1 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Fri, 11 Mar 2022 11:34:37 +0300 Subject: [PATCH] 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. --- pkg/core/native/management.go | 8 ++++---- pkg/core/native_management_test.go | 9 --------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pkg/core/native/management.go b/pkg/core/native/management.go index 6e0d3c836..f61c640d3 100644 --- a/pkg/core/native/management.go +++ b/pkg/core/native/management.go @@ -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) } diff --git a/pkg/core/native_management_test.go b/pkg/core/native_management_test.go index d03009af0..194d79567 100644 --- a/pkg/core/native_management_test.go +++ b/pkg/core/native_management_test.go @@ -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)