Browse Source

added -w to perl testing.pl

master
Tomas J. Camarero 3 years ago
committed by Brooke L. Rediker
parent
commit
70470d4e94
  1. 2
      lib
  2. 12
      modules.deps
  3. 8
      t/encode.t
  4. 11
      testing.pl

2
lib

@ -1 +1 @@
Subproject commit eaa1d8258b1c171c4e90fc62f4019301e6b2f4f5
Subproject commit d0e0fdddfdffff4d23405b029266ab02498a009e

12
modules.deps

@ -0,0 +1,12 @@
Crypt::Digest
Math::BigInt
Math::Base36
Encode::Base58::BigInt
LWP::UserAgent
Time::HiRes
Time::Local
Crypt::Digest::SHAKE
JSON
YAML::Syck
Digest::MurmurHash
Crypt::OpenSSL::ECDSA

8
t/encode.t

@ -5,11 +5,17 @@ use encode qw(encode_basen decode_basen);
my $msg = 'no work yet !'; my $msg = 'no work yet !';
my $nonce = unpack 'Q',&decode_basen($msg,29); my $nonce = unpack 'Q',&decode_basen($msg,29);
printf "nonce: %s\n",$nonce; printf "nonce: %s\n",$nonce;
printf "nonce16: %s\n",unpack'H*',pack('Q',$nonce);
printf "monce29: %s\n",&encode_basen(pack('Q',$nonce),29);
my $nonce = unpack 'Q',&decode_basen('genesis nonce',29);
printf "nonce: %s\n",$nonce;
printf "nonce16: %s\n",unpack'H*',pack('Q',$nonce);
printf "monce29: %s\n",&encode_basen(pack('Q',$nonce),29); printf "monce29: %s\n",&encode_basen(pack('Q',$nonce),29);
my $nonce = unpack 'Q',&decode_basen('initial nonce',29); my $nonce = unpack 'Q',&decode_basen('initial nonce',29);
printf "nonce: %s\n",$nonce; printf "nonce: %s\n",$nonce;
printf "nonce16: 0x%x\n",$nonce;
printf "nonce16: %s\n",unpack'H*',pack('Q',$nonce);
printf "monce29: %s\n",&encode_basen(pack('Q',$nonce),29); printf "monce29: %s\n",&encode_basen(pack('Q',$nonce),29);
$msg = &encode_basen("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF",29); $msg = &encode_basen("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF",29);

11
testing.pl

@ -1,4 +1,4 @@
#!/usr/bin/perl
#!/usr/bin/perl -w
# #
# Intent: # Intent:
@ -26,18 +26,19 @@ my $seed = &seed::setseed('Intentionally good!');
my $salt = rand64(); my $salt = rand64();
printf "salt: %s\n",$salt; printf "salt: %s\n",$salt;
my $headhash = $toychain::HEAD->{bkaddr};
my $headhash = $toychain::HEADs[0]->{bkaddr};
printf "genesis: %s\n",$headhash; printf "genesis: %s\n",$headhash;
print "// testing getTxMeta\n"; print "// testing getTxMeta\n";
my $txblock = getTxMeta(); my $txblock = getTxMeta();
print "// testing blockCreation\n"; print "// testing blockCreation\n";
my $block = &createBlock($seed,"This is the block payload",$txblock,'comment here!');
# createBlock(seed,payload,txblock,comment)
my $block = &createBlock($seed,"This is the 2nd block payload",$txblock,'1st comment for new block');
displayBlock($block); displayBlock($block);
print "// testing insertBlock:\n"; print "// testing insertBlock:\n";
my $chain = &insertBlock($toychain::HEAD,$block);
my $chain = &insertBlock($toychain::HEADs[0],$block);
displayChain($toychain::chain);
#displayChain($toychain::chain);

Loading…
Cancel
Save