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.

43 lines
790 B

3 years ago
3 years ago
3 years ago
3 years ago
  1. #!/usr/bin/perl
  2. #
  3. # Intent:
  4. # testing it !
  5. #
  6. # Note:
  7. # This work has been done during my time at Doctor I·T
  8. #
  9. # -- Copyright drit, 2021 --
  10. #
  11. BEGIN { if (-e $ENV{SITE}.'/lib') { use lib $ENV{SITE}.'/lib'; } }
  12. #use if -e $LIB, $LIB.'/seed';
  13. use seed qw(rand64);
  14. use functions qw(displayBlock);
  15. use toychain qw(blockHash);
  16. use YAML::Syck qw(Dump);
  17. print "// testing blockaddr\n";
  18. printf "chain.hash %s\n",$toychain::chain->[-1];
  19. printf "head.addr %s\n",$toychain::HEADs[0]->{bkaddr};
  20. my $block0 = $toychain::HEADs[0];
  21. # f96885aa : 21.4min
  22. # 044ce1de : 20.5min
  23. if (0) {
  24. &seed::setseed(0x21683774);
  25. my $n0 = rand64(); # n < 18446744073709551616
  26. printf "n0:%s\n",$n0;
  27. }
  28. displayBlock($block0);
  29. my $hash = &blockHash($block0);
  30. printf "head.hash %s\n",$hash;
  31. print ".\n";
  32. exit $?;
  33. 1;