From 70470d4e9442e65645478df389c0a37be4ba5a75 Mon Sep 17 00:00:00 2001 From: "Tomas J. Camarero" Date: Mon, 21 Jun 2021 19:00:04 +0200 Subject: [PATCH] added -w to perl testing.pl --- lib | 2 +- modules.deps | 12 ++++++++++++ t/encode.t | 8 +++++++- testing.pl | 11 ++++++----- 4 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 modules.deps diff --git a/lib b/lib index eaa1d82..d0e0fdd 160000 --- a/lib +++ b/lib @@ -1 +1 @@ -Subproject commit eaa1d8258b1c171c4e90fc62f4019301e6b2f4f5 +Subproject commit d0e0fdddfdffff4d23405b029266ab02498a009e diff --git a/modules.deps b/modules.deps new file mode 100644 index 0000000..f0a2a80 --- /dev/null +++ b/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 diff --git a/t/encode.t b/t/encode.t index fd989ce..0c020fc 100644 --- a/t/encode.t +++ b/t/encode.t @@ -5,11 +5,17 @@ use encode qw(encode_basen decode_basen); my $msg = 'no work yet !'; my $nonce = unpack 'Q',&decode_basen($msg,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); + +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); my $nonce = unpack 'Q',&decode_basen('initial nonce',29); 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); $msg = &encode_basen("\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF",29); diff --git a/testing.pl b/testing.pl index adc37e1..59901a1 100644 --- a/testing.pl +++ b/testing.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # # Intent: @@ -26,18 +26,19 @@ my $seed = &seed::setseed('Intentionally good!'); my $salt = rand64(); printf "salt: %s\n",$salt; -my $headhash = $toychain::HEAD->{bkaddr}; +my $headhash = $toychain::HEADs[0]->{bkaddr}; printf "genesis: %s\n",$headhash; print "// testing getTxMeta\n"; my $txblock = getTxMeta(); 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); print "// testing insertBlock:\n"; -my $chain = &insertBlock($toychain::HEAD,$block); +my $chain = &insertBlock($toychain::HEADs[0],$block); -displayChain($toychain::chain); +#displayChain($toychain::chain);