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

#
BEGIN { if (-e $ENV{SITE}.'/lib') { use lib $ENV{SITE}.'/lib'; } }
use toychain qw(by_txtime $config);
use YAML::Syck qw(Dump);
my $tics = time;
my $meta = 'no meta data here';
printf "--- config %s...\n",Dump($config);
my $txs = [
{'coinbase' => [ $config->{coinbase}{reward}, 'in', $tics, $meta ] },
{ 'user1' => [ $config->{coinbase}{reward}, 'out', $tics+1, $meta ] },
{ 'user2' => [ $config->{coinbase}{reward}, 'out', $tics-1, $meta ] }
];
printf "--- txs %s...\n",Dump($txs);
my $sorted = [ sort by_txtime @{$txs} ];
printf "sorted: %s\n",join"\n",@{$sorted};
exit $?;
1;