Added expiration test #114

Merged
kaykurokawa merged 1 commit from sanity-expiration-check into master 2018-04-16 18:32:52 +02:00
Showing only changes of commit 5e207992a1 - Show all commits

View file

@ -718,7 +718,6 @@ BOOST_AUTO_TEST_CASE(claimtriebranching_expire)
BOOST_CHECK(is_best_claim("test",tx3));
fixture.DecrementBlocks(1);
// check supports expire and can cause supported bid to lose claim
CMutableTransaction tx4 = fixture.MakeClaim(fixture.GetCoinbase(),"test","one",1);
CMutableTransaction tx5 = fixture.MakeClaim(fixture.GetCoinbase(),"test","one",2);
@ -729,6 +728,26 @@ BOOST_AUTO_TEST_CASE(claimtriebranching_expire)
CMutableTransaction u3 = fixture.MakeUpdate(tx5,"test","two",ClaimIdHash(tx5.GetHash(),0) ,2);
fixture.IncrementBlocks(pclaimTrie->nExpirationTime);
BOOST_CHECK(is_best_claim("test",u3));
fixture.DecrementBlocks(pclaimTrie->nExpirationTime);
BOOST_CHECK(is_best_claim("test",tx4));
fixture.DecrementBlocks(1);
// check updated claims will extend expiration
CMutableTransaction tx6 = fixture.MakeClaim(fixture.GetCoinbase(),"test","one",2);
fixture.IncrementBlocks(1);
BOOST_CHECK(is_best_claim("test",tx6));
CMutableTransaction u4 = fixture.MakeUpdate(tx6,"test","two",ClaimIdHash(tx6.GetHash(),0) ,2);
fixture.IncrementBlocks(1);
BOOST_CHECK(is_best_claim("test",u4));
fixture.IncrementBlocks(pclaimTrie->nExpirationTime-1);
BOOST_CHECK(is_best_claim("test",u4));
fixture.IncrementBlocks(1);
BOOST_CHECK(!is_best_claim("test",u4));
fixture.DecrementBlocks(1);
BOOST_CHECK(is_best_claim("test",u4));
fixture.DecrementBlocks(pclaimTrie->nExpirationTime);
BOOST_CHECK(is_best_claim("test",tx6));
}