Index: test/test.tcl ================================================================== --- test/test.tcl +++ test/test.tcl @@ -264,10 +264,37 @@ set verify [::nano::block::json::validateWork $block] if {!$verify} { puts "\[8.FAIL\] Got: $verify" puts "\[8.FAIL\] Exp: true" + return false + } + + # A typical block cycle + set seed DB4FDFD0F2ABED9E18ACF7FF20EC83ABAD34AAC6A77270A09EDEA5786E4CCF11 + set key [::nano::key::fromSeed $seed] + set account [::nano::address::fromPrivateKey $key] + set frontierHash $seed + ::nano::account::setFrontier $account $frontierHash 1 $account + set block [::nano::account::send $account $account 1 $key] + set block [::nano::block::json::work $block -update] + set block [::nano::block::json::filter $block] + set block [::nano::block::dict::fromJSON $block] + set signature [dict get $block "signature"] + set signature_expected "1E7AA03DB5CFCB1692A23D8F0DD29C854640B8954E96ECC84BD535D8D1FAADC7FE1008BB3473BE0DC328723E224D40F4B7B309CB78C33CAFC64635CA725FA50E" + if {$signature ne $signature_expected} { + puts "\[9.FAIL\] Got: $signature" + puts "\[9.FAIL\] Exp: $signature_expected" + + return false + } + + set verify [::nano::block::dict::validateWork $block] + if {!$verify} { + puts "\[10.FAIL\] Got: $verify" + puts "\[10.FAIL\] Exp: true" + return false } return true }