From f2e3be6fef65d703283cd1b308d98f62880034b2 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 9 Jun 2020 11:46:16 +0300 Subject: [PATCH] core: remove old AntShares interops We don't need them anymore. --- pkg/core/gas_price.go | 17 +++++++---------- pkg/core/interops.go | 35 ----------------------------------- 2 files changed, 7 insertions(+), 45 deletions(-) diff --git a/pkg/core/gas_price.go b/pkg/core/gas_price.go index 56094bc0b..4d67955d2 100644 --- a/pkg/core/gas_price.go +++ b/pkg/core/gas_price.go @@ -41,22 +41,19 @@ func getSyscallPrice(v *vm.VM, id uint32) util.Fixed8 { } const ( - neoContractCreate = 0x6ea56cf6 // Neo.Contract.Create - neoContractMigrate = 0x90621b47 // Neo.Contract.Migrate - antSharesContractCreate = 0x2a28d29b // AntShares.Contract.Create - antSharesContractMigrate = 0xa934c8bb // AntShares.Contract.Migrate - systemStoragePut = 0x84183fe6 // System.Storage.Put - systemStoragePutEx = 0x3a9be173 // System.Storage.PutEx - neoStoragePut = 0xf541a152 // Neo.Storage.Put - antSharesStoragePut = 0x5f300a9e // AntShares.Storage.Put + neoContractCreate = 0x6ea56cf6 // Neo.Contract.Create + neoContractMigrate = 0x90621b47 // Neo.Contract.Migrate + systemStoragePut = 0x84183fe6 // System.Storage.Put + systemStoragePutEx = 0x3a9be173 // System.Storage.PutEx + neoStoragePut = 0xf541a152 // Neo.Storage.Put ) estack := v.Estack() switch id { - case neoContractCreate, neoContractMigrate, antSharesContractCreate, antSharesContractMigrate: + case neoContractCreate, neoContractMigrate: return smartcontract.GetDeploymentPrice(smartcontract.PropertyState(estack.Peek(3).BigInt().Int64())) - case systemStoragePut, systemStoragePutEx, neoStoragePut, antSharesStoragePut: + case systemStoragePut, systemStoragePutEx, neoStoragePut: // price for storage PUT is 1 GAS per 1 KiB keySize := len(estack.Peek(1).Bytes()) valSize := len(estack.Peek(2).Bytes()) diff --git a/pkg/core/interops.go b/pkg/core/interops.go index a781bcdb5..7173fce5e 100644 --- a/pkg/core/interops.go +++ b/pkg/core/interops.go @@ -165,41 +165,6 @@ var neoInterops = []interop.Function{ // Aliases. {Name: "Neo.Iterator.Next", Func: enumerator.Next, Price: 1}, {Name: "Neo.Iterator.Value", Func: enumerator.Value, Price: 1}, - - // Old compatibility APIs. - {Name: "AntShares.Account.GetBalance", Func: accountGetBalance, Price: 1}, - {Name: "AntShares.Account.GetScriptHash", Func: accountGetScriptHash, Price: 1}, - {Name: "AntShares.Attribute.GetData", Func: attrGetData, Price: 1}, - {Name: "AntShares.Attribute.GetUsage", Func: attrGetUsage, Price: 1}, - {Name: "AntShares.Block.GetTransaction", Func: blockGetTransaction, Price: 1}, - {Name: "AntShares.Block.GetTransactionCount", Func: blockGetTransactionCount, Price: 1}, - {Name: "AntShares.Block.GetTransactions", Func: blockGetTransactions, Price: 1}, - {Name: "AntShares.Blockchain.GetAccount", Func: bcGetAccount, Price: 100}, - {Name: "AntShares.Blockchain.GetBlock", Func: bcGetBlock, Price: 200}, - {Name: "AntShares.Blockchain.GetContract", Func: bcGetContract, Price: 100}, - {Name: "AntShares.Blockchain.GetHeader", Func: bcGetHeader, Price: 100}, - {Name: "AntShares.Blockchain.GetHeight", Func: bcGetHeight, Price: 1}, - {Name: "AntShares.Blockchain.GetTransaction", Func: bcGetTransaction, Price: 100}, - {Name: "AntShares.Contract.Create", Func: contractCreate, Price: 0}, - {Name: "AntShares.Contract.Destroy", Func: contractDestroy, Price: 1}, - {Name: "AntShares.Contract.GetScript", Func: contractGetScript, Price: 1}, - {Name: "AntShares.Contract.GetStorageContext", Func: contractGetStorageContext, Price: 1}, - {Name: "AntShares.Contract.Migrate", Func: contractMigrate, Price: 0}, - {Name: "AntShares.Header.GetHash", Func: headerGetHash, Price: 1}, - {Name: "AntShares.Header.GetMerkleRoot", Func: headerGetMerkleRoot, Price: 1}, - {Name: "AntShares.Header.GetNextConsensus", Func: headerGetNextConsensus, Price: 1}, - {Name: "AntShares.Header.GetPrevHash", Func: headerGetPrevHash, Price: 1}, - {Name: "AntShares.Header.GetTimestamp", Func: headerGetTimestamp, Price: 1}, - {Name: "AntShares.Header.GetVersion", Func: headerGetVersion, Price: 1}, - {Name: "AntShares.Runtime.CheckWitness", Func: runtime.CheckWitness, Price: 200}, - {Name: "AntShares.Runtime.Log", Func: runtimeLog, Price: 1}, - {Name: "AntShares.Runtime.Notify", Func: runtimeNotify, Price: 1}, - {Name: "AntShares.Storage.Delete", Func: storageDelete, Price: 100}, - {Name: "AntShares.Storage.Get", Func: storageGet, Price: 100}, - {Name: "AntShares.Storage.GetContext", Func: storageGetContext, Price: 1}, - {Name: "AntShares.Storage.Put", Func: storagePut, Price: 0}, - {Name: "AntShares.Transaction.GetAttributes", Func: txGetAttributes, Price: 1}, - {Name: "AntShares.Transaction.GetHash", Func: txGetHash, Price: 1}, } // initIDinInteropsSlice initializes IDs from names in one given