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:
parent
bedfd75086
commit
150041d25e
2 changed files with 4 additions and 13 deletions
|
@ -200,7 +200,7 @@ func (m *Management) getNefAndManifestFromItems(ic *interop.Context, args []stac
|
||||||
|
|
||||||
gas := ic.Chain.GetStoragePrice() * int64(len(nefBytes)+len(manifestBytes))
|
gas := ic.Chain.GetStoragePrice() * int64(len(nefBytes)+len(manifestBytes))
|
||||||
if isDeploy {
|
if isDeploy {
|
||||||
fee := m.GetMinimumDeploymentFee(ic.DAO)
|
fee := m.minimumDeploymentFee(ic.DAO)
|
||||||
if fee > gas {
|
if fee > gas {
|
||||||
gas = fee
|
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 {
|
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.
|
// minimumDeploymentFee returns the minimum required fee for contract deploy.
|
||||||
func (m *Management) GetMinimumDeploymentFee(dao *dao.Simple) int64 {
|
func (m *Management) minimumDeploymentFee(dao *dao.Simple) int64 {
|
||||||
return getIntWithKey(m.ID, dao, keyMinimumDeploymentFee)
|
return getIntWithKey(m.ID, dao, keyMinimumDeploymentFee)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,15 +14,6 @@ type memoryStore struct {
|
||||||
|
|
||||||
func (memoryStore) Close() error { return nil }
|
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) {
|
func TestManagement_GetNEP17Contracts(t *testing.T) {
|
||||||
t.Run("empty chain", func(t *testing.T) {
|
t.Run("empty chain", func(t *testing.T) {
|
||||||
chain := newTestChain(t)
|
chain := newTestChain(t)
|
||||||
|
|
Loading…
Add table
Reference in a new issue