Permalink
Browse files

fixing bad test version numbers

  • Loading branch information...
1 parent 53471c8 commit 2c921ce42a3bb0ff1ab06d51af789dc7618900d6 @grondilu committed Sep 27, 2012
Showing with 12 additions and 9 deletions.
  1. +3 −5 Bitcoin.pm
  2. +5 −1 Bitcoin/Block.pm
  3. +2 −0 Bitcoin/Constants.pm
  4. +2 −3 README
View
@@ -15,9 +15,7 @@ sub import {
import bigint;
use overload;
- unless( ':nomagic' ~~ [ @_ ]
- or not Bitcoin::Constants::MAGIC
- ) {
+ unless( ':nomagic' ~~ [ @_ ] or not Bitcoin::Constants::MAGIC) {
# This allows magical recognition of bitcoin addresses or keys in
# string literals.
overload::constant q => sub {
@@ -43,7 +41,7 @@ our @ISA = qw(
EC::DSA::PrivateKey
);
sub size() { 256 }
-sub version() { $ENV{BITCOIN_TEST} ~~ /yes|true/i ? 129 : 128 }
+sub version() { Bitcoin::Constants::THIS_IS_TEST ? 239 : 128 }
sub value { bless shift->copy(), 'Math::BigInt'; }
sub address { new Bitcoin::Address shift->public_key }
@@ -67,7 +65,7 @@ sub new {
package Bitcoin::Address;
our @ISA = qw(Bitcoin::Base58::Data);
sub size() { 160 }
-sub version() { $ENV{BITCOIN_TEST} ~~ /yes|true/i ? 1 : 0 }
+sub version() { Bitcoin::Constants::THIS_IS_TEST ? 111 : 0 }
sub data {
my $this = shift;
ref $this ? $this->{data} : $this->SUPER::data(@_);
View
@@ -5,7 +5,11 @@ require Bitcoin::Constants;
package Bitcoin::Block;
use strict;
use warnings;
-use overload '""' => sub { use YAML; Dump shift };
+use overload '""' => sub {
+ use YAML;
+ use MIME::QuotedPrint;
+ encode_qp Dump(shift), "\015\012";
+};
sub depth { shift->{depth} }
sub work { shift->{work} }
View
@@ -30,6 +30,8 @@ use constant {
)
],
+ DEFAULT_PORT => THIS_IS_TEST ? 18333 : 8333,
+
IRC => {
SERVER => 'irc.lfnet.org',
PORT => 6667,
View
5 README
@@ -7,9 +7,8 @@ Perl implementation of the bitcoin protocol
Requires v5.14 and beyond, at least because of an extensive use of the 'r'
modifier in s///
-Requires dc, the unix desktop calculator, as it is much faster than Math::BigInt, even
-with GMP.
+Can optionaly use dc, the unix desktop calculator, as it is much faster than Math::BigInt, even with GMP.
-Requires also: BerkeleyDB, Convert::ASN1, File::Map, Net::IRC
+Requires also: BerkeleyDB, Convert::ASN1, File::Map
THIS IS WORK IN PROGRESS, PROVIDED WITH ABSOLUTELY NO GUARANTEE WHATSOEVER

0 comments on commit 2c921ce

Please sign in to comment.