core: remove old AntShares interops

We don't need them anymore.
This commit is contained in:
Anna Shaleva 2020-06-09 11:46:16 +03:00
parent 7ddcc35daf
commit f2e3be6fef
2 changed files with 7 additions and 45 deletions

View file

@ -41,22 +41,19 @@ func getSyscallPrice(v *vm.VM, id uint32) util.Fixed8 {
} }
const ( const (
neoContractCreate = 0x6ea56cf6 // Neo.Contract.Create neoContractCreate = 0x6ea56cf6 // Neo.Contract.Create
neoContractMigrate = 0x90621b47 // Neo.Contract.Migrate neoContractMigrate = 0x90621b47 // Neo.Contract.Migrate
antSharesContractCreate = 0x2a28d29b // AntShares.Contract.Create systemStoragePut = 0x84183fe6 // System.Storage.Put
antSharesContractMigrate = 0xa934c8bb // AntShares.Contract.Migrate systemStoragePutEx = 0x3a9be173 // System.Storage.PutEx
systemStoragePut = 0x84183fe6 // System.Storage.Put neoStoragePut = 0xf541a152 // Neo.Storage.Put
systemStoragePutEx = 0x3a9be173 // System.Storage.PutEx
neoStoragePut = 0xf541a152 // Neo.Storage.Put
antSharesStoragePut = 0x5f300a9e // AntShares.Storage.Put
) )
estack := v.Estack() estack := v.Estack()
switch id { switch id {
case neoContractCreate, neoContractMigrate, antSharesContractCreate, antSharesContractMigrate: case neoContractCreate, neoContractMigrate:
return smartcontract.GetDeploymentPrice(smartcontract.PropertyState(estack.Peek(3).BigInt().Int64())) 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 // price for storage PUT is 1 GAS per 1 KiB
keySize := len(estack.Peek(1).Bytes()) keySize := len(estack.Peek(1).Bytes())
valSize := len(estack.Peek(2).Bytes()) valSize := len(estack.Peek(2).Bytes())

View file

@ -165,41 +165,6 @@ var neoInterops = []interop.Function{
// Aliases. // Aliases.
{Name: "Neo.Iterator.Next", Func: enumerator.Next, Price: 1}, {Name: "Neo.Iterator.Next", Func: enumerator.Next, Price: 1},
{Name: "Neo.Iterator.Value", Func: enumerator.Value, 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 // initIDinInteropsSlice initializes IDs from names in one given