# BEGIN { if (-e $ENV{SITE}.'/lib') { use lib $ENV{SITE}.'/lib'; } } use TXPOOL qw($TXPOOL $UTXO createTx isTxValid addTxPool); use CAStore qw(CASRead); use YAML::Syck qw(Dump); printf "--- keys %s...\n",Dump($ECKeys::keys); printf "--- aliases %s...\n",Dump($ECKeys::aliases); $UTXO->{$ECKeys::keys->{faucet}{public}} = 1; printf "--- UTXO %s...\n",Dump($UTXO); my $tx = { message => 'this is a test transaction', inputs => [ { 'faucet' => 1 } ], outputs => [ { 'self' => 1 } ] }; my ($txaddr,$tx) = &createTx($tx,'txpool'); printf "txaddr: %s\n",$txaddr; my $txok = &isTxValid($tx); printf "is %s valid: ? %s\n",$txaddr,$txok; if ($txok) { &addTxPool($txaddr); } print "TxPool:\n"; for my $i (0 .. $#$TXPOOL) { printf " %d. %s\n",$i,$TXPOOL->[$i]; } print ".]n"; #my $txp = &CASRead($ENV{SITE}.'/txpool',$txaddr); #printf "--- txp %s...\n",Dump($txp); exit $?; 1;