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.

28 lines
616 B

  1. #
  2. BEGIN { if (-e $ENV{SITE}.'/lib') { use lib $ENV{SITE}.'/lib'; } }
  3. use toychain qw(by_txtime $config);
  4. use YAML::Syck qw(Dump);
  5. my $tics = time;
  6. my $meta = 'no meta data here';
  7. printf "--- config %s...\n",Dump($config);
  8. my $txs = [
  9. {'coinbase' => [ $config->{coinbase}{reward}, 'in', $tics, $meta ] },
  10. { 'user1' => [ $config->{coinbase}{reward}, 'out', $tics+1, $meta ] },
  11. { 'user2' => [ $config->{coinbase}{reward}, 'out', $tics-1, $meta ] }
  12. ];
  13. printf "--- txs %s...\n",Dump($txs);
  14. my $sorted = [ sort by_txtime @{$txs} ];
  15. printf "sorted: %s\n",join"\n",@{$sorted};
  16. exit $?;
  17. 1;