|
@ -13,7 +13,7 @@ BEGIN { print "// ToyChain !\n"; } |
|
|
|
|
|
|
|
|
use lib 'lib'; |
|
|
use lib 'lib'; |
|
|
use seed qw(rand64); |
|
|
use seed qw(rand64); |
|
|
use misc qw(khash $ZNull); |
|
|
|
|
|
|
|
|
use misc qw(khash $Zempty); |
|
|
use toychain; |
|
|
use toychain; |
|
|
use encode qw(mbase58); |
|
|
use encode qw(mbase58); |
|
|
|
|
|
|
|
@ -30,6 +30,7 @@ printf "genesis: %s\n",$headhash; |
|
|
print "// testing getTxMeta\n"; |
|
|
print "// testing getTxMeta\n"; |
|
|
my $txblock = getTxMeta(); |
|
|
my $txblock = getTxMeta(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "// testing blockCreation\n"; |
|
|
print "// testing blockCreation\n"; |
|
|
# createBlock(seed,payload,txblock,comment) |
|
|
# createBlock(seed,payload,txblock,comment) |
|
|
my $block = &createBlock($seed,"This is the 2nd block payload",$txblock,'1st comment for new block'); |
|
|
my $block = &createBlock($seed,"This is the 2nd block payload",$txblock,'1st comment for new block'); |
|
@ -37,11 +38,13 @@ displayBlock($block); |
|
|
print "// testing insertBlock:\n"; |
|
|
print "// testing insertBlock:\n"; |
|
|
my $chain = &insertBlock($toychain::HEADs[0],$block); |
|
|
my $chain = &insertBlock($toychain::HEADs[0],$block); |
|
|
|
|
|
|
|
|
|
|
|
createDot($toychain::chain); |
|
|
|
|
|
|
|
|
displayChain($toychain::chain); |
|
|
displayChain($toychain::chain); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#$head = newBlock(1,'this is a playload',$ZNull,$head,$salt); |
|
|
|
|
|
|
|
|
#$head = newBlock(1,'this is a playload',$Zempty,$head,$salt); |
|
|
#printf "head: %s\n",mbase58($head); |
|
|
#printf "head: %s\n",mbase58($head); |
|
|
|
|
|
|
|
|
exit $?; |
|
|
exit $?; |
|
|