native: implement designate contract history retention

Follow neo-project/neo#2007. Fix getDesignatedByRole price along the way.
This commit is contained in:
Roman Khimov 2020-11-05 19:34:48 +03:00
parent 7121686571
commit 9e781bff47
6 changed files with 174 additions and 49 deletions

View file

@ -499,7 +499,9 @@ func TestVerifyTx(t *testing.T) {
InvocationScript: testchain.SignCommittee(txSetOracle.GetSignedPart()),
VerificationScript: testchain.CommitteeVerificationScript(),
}}
ic := bc.newInteropContext(trigger.All, bc.dao, nil, txSetOracle)
bl := block.New(netmode.UnitTestNet)
bl.Index = bc.BlockHeight() + 1
ic := bc.newInteropContext(trigger.All, bc.dao, bl, txSetOracle)
ic.SpawnVM()
ic.VM.LoadScript([]byte{byte(opcode.RET)})
require.NoError(t, bc.contracts.Designate.DesignateAsRole(ic, native.RoleOracle, oraclePubs))