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

  1. #
  2. BEGIN { if (-e $ENV{SITE}.'/lib') { use lib $ENV{SITE}.'/lib'; } }
  3. use TXPOOL qw($TXPOOL $UTXO createTx isTxValid addTxPool);
  4. use CAStore qw(CASRead);
  5. use YAML::Syck qw(Dump);
  6. printf "--- keys %s...\n",Dump($ECKeys::keys);
  7. printf "--- aliases %s...\n",Dump($ECKeys::aliases);
  8. $UTXO->{$ECKeys::keys->{faucet}{public}} = 1;
  9. printf "--- UTXO %s...\n",Dump($UTXO);
  10. my $tx = {
  11. message => 'this is a test transaction',
  12. inputs => [ { 'faucet' => 1 } ],
  13. outputs => [ { 'self' => 1 } ]
  14. };
  15. my ($txaddr,$tx) = &createTx($tx,'txpool');
  16. printf "txaddr: %s\n",$txaddr;
  17. my $txok = &isTxValid($tx);
  18. printf "is %s valid: ? %s\n",$txaddr,$txok;
  19. if ($txok) {
  20. &addTxPool($txaddr);
  21. }
  22. print "TxPool:\n";
  23. for my $i (0 .. $#$TXPOOL) {
  24. printf " %d. %s\n",$i,$TXPOOL->[$i];
  25. }
  26. print ".]n";
  27. #my $txp = &CASRead($ENV{SITE}.'/txpool',$txaddr);
  28. #printf "--- txp %s...\n",Dump($txp);
  29. exit $?;
  30. 1;