core/tests: fix NameService test

We should look for the timestamp of the block with `register`.
This commit is contained in:
Evgeniy Stratonikov 2021-02-08 17:56:08 +03:00
parent 71494e6ae4
commit 468dc5aad6

View file

@ -151,13 +151,12 @@ func TestRegisterAndRenew(t *testing.T) {
testNameServiceInvoke(t, bc, "balanceOf", 0, testchain.CommitteeScriptHash()) testNameServiceInvoke(t, bc, "balanceOf", 0, testchain.CommitteeScriptHash())
testNameServiceInvokeAux(t, bc, defaultRegisterSysfee, true, "register", testNameServiceInvokeAux(t, bc, defaultRegisterSysfee, true, "register",
true, "neo.com", testchain.CommitteeScriptHash()) true, "neo.com", testchain.CommitteeScriptHash())
topBlock := bc.topBlock.Load().(*block.Block)
expectedExpiration := topBlock.Timestamp/1000 + secondsInYear
testNameServiceInvokeAux(t, bc, defaultRegisterSysfee, true, "register", testNameServiceInvokeAux(t, bc, defaultRegisterSysfee, true, "register",
false, "neo.com", testchain.CommitteeScriptHash()) false, "neo.com", testchain.CommitteeScriptHash())
testNameServiceInvoke(t, bc, "isAvailable", false, "neo.com") testNameServiceInvoke(t, bc, "isAvailable", false, "neo.com")
topBlock := bc.topBlock.Load().(*block.Block)
expectedExpiration := topBlock.Timestamp/1000 + secondsInYear
props := stackitem.NewMap() props := stackitem.NewMap()
props.Add(stackitem.Make("name"), stackitem.Make("neo.com")) props.Add(stackitem.Make("name"), stackitem.Make("neo.com"))
props.Add(stackitem.Make("description"), stackitem.Make("")) props.Add(stackitem.Make("description"), stackitem.Make(""))