anchor.diff:      reveal:reveal(),
       buy_block(),
       tx_pool:absorb(sign_tx(slasher_tx:slasher(1, keys:sign({sign_tx, 0, 0, 0, 0, 0, 0})), Pub, Priv)),
  +    CreateTx1 = to_channel_tx:create_channel(1, 10000, 1000, delegated_1, 0),
  +    SignedCreateTx1 = sign_tx(CreateTx1, Pub, Priv),
  +    tx_pool:absorb(SignedCreateTx1),
  +    CreateTx2 = to_channel_tx:create_channel(1, 10000, 1000, delegated_1, 0),
  +    SignedCreateTx2 = sign_tx(CreateTx2, Pub, Priv),
  +    tx_pool:absorb(SignedCreateTx2),
  +    CreateTx3 = to_channel_tx:create_channel(1, 10000, 1000, delegated_1, 0),
  +    SignedCreateTx3 = sign_tx(CreateTx3, Pub, Priv),
  +    tx_pool:absorb(SignedCreateTx3),
  +    sign_tx:sign(),
  +    reveal:reveal(),
  +    buy_block(),
  +    ToChannel = to_channel_tx:to_channel(24000, 0, 10, 0),
  +    SignedToChannel = sign_tx(ToChannel, Pub, Priv),
  +    tx_pool:absorb(SignedToChannel),
  +    sign_tx:sign(),
  +    reveal:reveal(),
  +    buy_block(),%needs to start with some big channels with myself, so I have enough delegation.
  +    ChannelTx = channel_block_tx:close_channel(24000, -200, 1),
  +    TimeoutTx = channel_block_tx:channel_block(24001, -200, 1, 0),
  +    SlasherTx = channel_block_tx:channel_block(24002, -200, 1, 10),
  +    SignedChannelTx = sign_tx(ChannelTx, Pub, Priv),
  +    SignedTimeoutTx = sign_tx(TimeoutTx, Pub, Priv),
  +    SignedSlasherTx = sign_tx(SlasherTx, Pub, Priv),
  +    Acc1 = account(1),
  +    A1 = accounts:balance(Acc1),
  +    tx_pool:absorb(SignedChannelTx),
  +    Acc2 = account(1),
  +    A2 = accounts:balance(Acc2),
  +    true = A2 < A1,%4000 fee per block, only gain 1010.
  +    channel_timeout_tx:timeout_channel(SignedTimeoutTx),
  +    channel_timeout_tx:timeout_channel(SignedSlasherTx),
  +    sign_tx:sign(),
  +    reveal:reveal(),
  +    buy_block(),
  +    channel_close_tx:slow_close(24001),
  +    SlashBlock = channel_block_tx:channel_block(24002, 0, 2, 5),
  +    SignedSlashBlock = sign_tx(SlashBlock, Pub, Priv),
  +    AccOne = account(1),
  +    ChannelSlashTx = {channel_slash, 1, accounts:nonce(AccOne), SignedSlashBlock},
  +    SignedChannelSlashTx = sign:sign_tx(ChannelSlashTx, Pub, Priv, tx_pool:accounts()),
  +    tx_pool:absorb(SignedChannelSlashTx),
  +    sign_tx:sign(),
  +    reveal:reveal(),
  +    buy_block(),
  +    sign_tx:sign(),
  +    reveal:reveal(),
  +    {Pub2, Priv2} = sign:new_key(),
  +    create_account_tx:create_account(Pub2, 650000),
  +    buy_block(),
  +    sign_tx:sign(),
  +    reveal:reveal(),
  +    tx_pool:absorb(sign_tx(delete_account_tx:delete_account(2, 0, 0), Pub2, Priv2)),
  +    create_account_tx:create_account(Pub2, 680000),
  +    buy_block(),
  +    CreateTxq = to_channel_tx:create_channel(2, 1, 0, delegated_2, 0),
  +    SignedCreateTxq = sign_tx(CreateTxq, Pub2, Priv2),
  +    EmptyChannel = channels:empty(),
  +    true = EmptyChannel == channel(24000),
  +    tx_pool:absorb(SignedCreateTxq),
  +    false = EmptyChannel == channel(24000),
  +    reveal:reveal(),
  +    sign_tx:sign(),
  +    success.
  +long_test() -> 
  +    {Pub, Priv} = sign:new_key(),
  +    create_account_tx:create_account(Pub, 620000),
  +    spend_tx:spend(1, 10),
  +    sign_tx:sign(),
  +    reveal:reveal(),
  +    buy_block(),
  +    tx_pool:absorb(sign_tx(slasher_tx:slasher(1, keys:sign({sign_tx, 0, 0, 0, 0, 0, 0})), Pub, Priv)),
       Top = read(read(top)),
       CreateTx1 = to_channel_tx:create_channel(1, 10000, 1000, delegated_1, 0),
       SignedCreateTx1 = sign_tx(CreateTx1, Pub, Priv),
  
positive.code: -module(block_tree).
  -behaviour(gen_server).
  -export([start_link/0,code_change/3,handle_call/3,handle_cast/2,handle_info/2,init/1,terminate/2, test/0,write/1,top/0,read/1,read_int/2,read_int/1,secret/4,account/1,account/2,account/3,channel/2,channel/3,channel/1,absorb/1,is_key/1,height/1,height/0,txs/1,txs/0,power/0,power/1,block/0,block/1,buy_block/2, block_power/1,block_entropy/1,empty_block/0,total_coins/0, buy_block/0, block_number/1, block2txs/1]).
  -record(block, {acc = 0, number = 0, hash = "", txs = [], power = fractions:multiply_int(constants:initial_portion_delegated(), constants:initial_coins()), entropy = 0, total_coins = constants:initial_coins(), db_root = <<>>}).
  %power is how many coin are in channels. it is for consensus.
  block_number(B) -> B#block.number.
  
negative.code:     false = EmptyChannel == channel(24000),
      reveal:reveal(),
      sign_tx:sign(),
  
      F = fun() -> sign_tx:sign(), buy_block() end,
      G = fun() -> F(), F(), F(), F(), F(), F(), F(), F() end,
      H = fun() -> G(), G(), G(), G(), G(), G(), G(), G() end,
  