I thought I'd go through some of the blockchain test logic to see if I can explain it. Hopefully I can interpret it clearly enough without too much jargon. In doing so, maybe I'll be able to spell out certain details for my readers.
In this example, we're looking at how it's important that the @null balance always gets zeroed out. It's part of consensus that its balance always becomes zero, no matter how funds are transferred to it. This is known as burning assets.
The logic I'm interpreting here comes from this code revision:
clear_null_accountThe name of this verification routine is clear_null_account. It is intended to check if the blockchain behavior really does what the developers expect. Specifically, the developers want to know if the null account really has a zero balance.
Setup Phase:
alice) is summoned into existence as a blockchain actor.alice:10.000 TESTS (similar to STEEM on testnet)10.000 TBD (similar to SBD on testnet)alice to null in the amount of 1.000 TESTS.alice to null in the amount of 2.000 TBD.null as VESTS):alice to null in the amount of 3.000 TESTS.alice to null in the amount of 4.000 TESTS.alice to null in the amount of 5.000 TBD.null in addition to what alice transferred above:1.000 TESTS1.000 TBD1.000000 VESTS (as vesting balance)1.000 TESTS (as vesting STEEM)2.000 TESTS into the current supply.3.000 TESTS into the virtual supply.1.000 TBD into the current supply.1.000000 VESTS into the rewarded vesting shares.1.000 TESTS into the rewarded vesting STEEM.Test Phase:
null.null balances are now zero (including VESTS).null reward balances are now zero (including VESTS).alice is 2.000 TESTSalice is 3.000 TBDIf all of the above takes place, the test case passes and we are now sure that the null balance behaves as we expect.
Going through this simple test I did learn something. I knew that there were several methods of transferring assets. But it hadn't occurred that each asset was really zeroed out for null.
This is because we typically only send SBD (TBD on testnet) to null for post promotion. But the blockchain supports all asset types, so even reward balances and VESTS are checked.
It makes sense that this is the case and it's great to see that this behavior is explicitly being evaluated in the tests.