You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

42 lines
892 B

#
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;