Skip to content

Commit

Permalink
Merge pull request #1617 from nspcc-dev/fix/transfer
Browse files Browse the repository at this point in the history
native: fix `NEP17.Transfer` cost
  • Loading branch information
roman-khimov authored Dec 15, 2020
2 parents f009e53 + 5310c7f commit 42be00b
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 7 deletions.
Binary file modified cli/testdata/chain50x2.acc
Binary file not shown.
2 changes: 1 addition & 1 deletion internal/testchain/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func NewTransferFromOwner(bc blockchainer.Blockchainer, contractHash, to util.Ui
}

script := w.Bytes()
tx := transaction.New(netmode.UnitTestNet, script, 10000000)
tx := transaction.New(netmode.UnitTestNet, script, 11000000)
tx.ValidUntilBlock = validUntil
tx.Nonce = nonce
tx.Signers = []transaction.Signer{{
Expand Down
2 changes: 1 addition & 1 deletion pkg/consensus/consensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func initServiceNextConsensus(t *testing.T, newAcc *wallet.Account, offset uint3
emit.Opcodes(w.BinWriter, opcode.ASSERT)
require.NoError(t, w.Err)

tx := transaction.New(netmode.UnitTestNet, w.Bytes(), 20_000_000)
tx := transaction.New(netmode.UnitTestNet, w.Bytes(), 21_000_000)
tx.ValidUntilBlock = bc.BlockHeight() + 1
tx.NetworkFee = 10_000_000
tx.Signers = []transaction.Signer{{Scopes: transaction.Global, Account: acc.Contract.ScriptHash()}}
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ func newNEP17Transfer(sc, from, to util.Uint160, amount int64, additionalArgs ..
emit.Opcodes(w.BinWriter, opcode.ASSERT)

script := w.Bytes()
return transaction.New(testchain.Network(), script, 10000000)
return transaction.New(testchain.Network(), script, 11000000)
}

func newDeployTx(t *testing.T, bc *Blockchain, sender util.Uint160, name, ctrName string) (*transaction.Transaction, util.Uint160) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/native/native_nep17.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func newNEP17Native(name string) *nep17TokenNative {
desc = newDescriptor("transfer", smartcontract.BoolType,
append(transferParams, manifest.NewParameter("data", smartcontract.AnyType))...,
)
md = newMethodAndPrice(n.Transfer, 8000000, smartcontract.WriteStates|smartcontract.AllowCall|smartcontract.AllowNotify)
md = newMethodAndPrice(n.Transfer, 9000000, smartcontract.WriteStates|smartcontract.AllowCall|smartcontract.AllowNotify)
n.AddMethod(md, desc)

n.AddEvent("Transfer", transferParams...)
Expand Down
2 changes: 1 addition & 1 deletion pkg/core/native_neo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestNEO_Vote(t *testing.T) {
tx := transaction.New(netmode.UnitTestNet, w.Bytes(), 0)
tx.ValidUntilBlock = bc.BlockHeight() + 1
tx.NetworkFee = 2_000_000
tx.SystemFee = 10_000_000
tx.SystemFee = 11_000_000
setSigner(tx, h)
require.NoError(t, accs[i].SignTx(tx))
txs = append(txs, tx)
Expand Down
4 changes: 2 additions & 2 deletions pkg/rpc/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type rpcTestCase struct {
}

const testContractHash = "743ed26f78e29ecd595535b74a943b1f9ccbc444"
const deploymentTxHash = "37644146394ad76ddb9431d10b724a3cad5f8b249abdaed0b086fcd761756951"
const deploymentTxHash = "63605d1ba55b829b7816f2a2016e34b87296dcc824d069b2ee0aef1c1f5898dd"
const genesisBlockHash = "0542f4350c6e236d0509bcd98188b0034bfbecc1a0c7fcdb8e4295310d468b70"

const verifyContractHash = "a2eb22340979804cb10cc1add0b8822c201f4d8a"
Expand Down Expand Up @@ -1347,7 +1347,7 @@ func checkNep17Balances(t *testing.T, e *executor, acc interface{}) {
},
{
Asset: e.chain.UtilityTokenHash(),
Amount: "80009634770",
Amount: "80006564770",
LastUpdated: 7,
}},
Address: testchain.PrivateKeyByID(0).GetScriptHash().StringLE(),
Expand Down
Binary file modified pkg/rpc/server/testdata/testblocks.acc
Binary file not shown.

0 comments on commit 42be00b

Please sign in to comment.