#!/usr/bin/perl -w # # Intent: # testing it ! # # Note: # This work has been done during my time at Doctor I·T # # -- Copyright drit, 2021 -- # BEGIN { print "// ToyChain !\n"; } use lib 'lib'; use seed qw(rand64); use misc qw(khash $null); use toychain; use encode qw(mbase58); #printf "encode::EXPORT_OK: %s\n",join',',@encode::EXPORT_OK; printf "ZNull: %s\n",&mbase58($null); use YAML::Syck qw(Dump); my $seed = &seed::setseed('Intentionally good!'); my $salt = rand64(); printf "salt: %s\n",$salt; my $headhash = $toychain::HEADs[0]->{bkaddr}; printf "genesis: %s\n",$headhash; print "// testing getTxMeta\n"; my $txblock = getTxMeta(); print "// testing blockCreation\n"; # createBlock(seed,payload,txblock,comment) my $block = &createBlock($seed,"This is the 2nd block payload",$txblock,'1st comment for new block'); displayBlock($block); print "// testing insertBlock:\n"; my $chain = &insertBlock($toychain::HEADs[0],$block); #displayChain($toychain::chain); #$head = newBlock(1,'this is a playload',$ZNull,$head,$salt); #printf "head: %s\n",mbase58($head); exit $?; 1;