blockchain-lite 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b722f05bc1278363432a4645667ea2f1f6beb135
4
- data.tar.gz: ecb976219a2e0f7b9ff8ad90a8f7ebd60d9ba052
3
+ metadata.gz: ccf43eee1725688110917d1fa4f252448b08c10f
4
+ data.tar.gz: 56476b389bcdf4abdb42b623485e303686f32f34
5
5
  SHA512:
6
- metadata.gz: d56f16148e7706e848183a94f4a6133f88b26591e34db1c3e024ab4dd0b8e7a5d94d8711101962bfc5108d52de8711ca9fe00dbf418a8bbb218dc01817d78ab9
7
- data.tar.gz: 861642febb265b139bf25e4da9d305cbabf28be8797a918e9834ddf00204d68fa9cb70df5a302c88052ce550107d4680db44d41ecf0321dc6530ba7277775781
6
+ metadata.gz: 6d069c0c8a7c2d58268cb2c56a5fae5126f36bd10f75238f3ccefdff32c90599467465c9683bc0c56e3d748f81e364d7b568b7b09a105faba34ee51f91fce3a9
7
+ data.tar.gz: c9d6579d3b24560fb709631b2682afd37ae8fd4af9bc8202db278011a4ca711ec836f37e61ea5932313ec6f5ecfb0163b9d672f8c48ba3d95166c694e5a1b094
@@ -38,25 +38,25 @@ class Block
38
38
 
39
39
 
40
40
 
41
- def self.first( *transactions ) # create genesis (big bang! first) block
41
+ def self.first( *args ) # create genesis (big bang! first) block
42
42
  ## note: allow/support splat-* for now for convenience (auto-wraps args into array)
43
- if transactions.size == 1 && transactions[0].is_a?( Array )
44
- t = transactions[0] ## "unwrap" array in array
43
+ if args.size == 1 && args[0].is_a?( Array )
44
+ transactions = args[0] ## "unwrap" array in array
45
45
  else
46
- t = transactions ## use "auto-wrapped" splat array
46
+ transactions = args ## use "auto-wrapped" splat array
47
47
  end
48
48
  ## uses index zero (0) and arbitrary previous_hash ('0')
49
- Block.new( 0, t, '0' )
49
+ Block.new( 0, transactions, '0' )
50
50
  end
51
51
 
52
- def self.next( previous, *transactions )
52
+ def self.next( previous, *args )
53
53
  ## note: allow/support splat-* for now for convenience (auto-wraps args into array)
54
- if transactions.size == 1 && transactions[0].is_a?( Array )
55
- t = transactions[0] ## "unwrap" array in array
54
+ if args.size == 1 && args[0].is_a?( Array )
55
+ transactions = args[0] ## "unwrap" array in array
56
56
  else
57
- t = transactions ## use "auto-wrapped" splat array
57
+ transactions = args ## use "auto-wrapped" splat array
58
58
  end
59
- Block.new( previous.index+1, t, previous.hash )
59
+ Block.new( previous.index+1, transactions, previous.hash )
60
60
  end
61
61
 
62
62
  end # class Block
@@ -45,7 +45,7 @@ class Blockchain
45
45
  ## must be added by to make sure proper block_class is always used - why? why not??
46
46
 
47
47
  def <<( arg )
48
- if arg.is_a? Array ## assume its (just) data
48
+ if arg.is_a?( Array ) ## assume its (just) data
49
49
  data = arg
50
50
  bl = @chain.last
51
51
  b = @block_class.next( bl, data )
@@ -45,26 +45,26 @@ class Block
45
45
 
46
46
 
47
47
 
48
- def self.first( *transactions, **opts ) # create genesis (big bang! first) block
48
+ def self.first( *args, **opts ) # create genesis (big bang! first) block
49
49
  ## note: allow/support splat-* for now for convenience (auto-wraps args into array)
50
- if transactions.size == 1 && transactions[0].is_a?( Array )
51
- t = transactions[0] ## "unwrap" array in array
50
+ if args.size == 1 && args[0].is_a?( Array )
51
+ transactions = args[0] ## "unwrap" array in array
52
52
  else
53
- t = transactions ## use "auto-wrapped" splat array
53
+ transactions = args ## use "auto-wrapped" splat array
54
54
  end
55
55
  ## uses index zero (0) and arbitrary previous_hash ('0')
56
56
  ## note: pass along (optional) custom timestamp (e.g. used for 1637 etc.)
57
- Block.new( 0, t, '0', timestamp: opts[:timestamp] )
57
+ Block.new( 0, transactions, '0', timestamp: opts[:timestamp] )
58
58
  end
59
59
 
60
- def self.next( previous, *transactions, **opts )
60
+ def self.next( previous, *args, **opts )
61
61
  ## note: allow/support splat-* for now for convenience (auto-wraps args into array)
62
- if transactions.size == 1 && transactions[0].is_a?( Array )
63
- t = transactions[0] ## "unwrap" array in array
62
+ if args.size == 1 && args[0].is_a?( Array )
63
+ transactions = args[0] ## "unwrap" array in array
64
64
  else
65
- t = transactions ## use "auto-wrapped" splat array
65
+ transactions = args ## use "auto-wrapped" splat array
66
66
  end
67
- Block.new( previous.index+1, t, previous.hash, timestamp: opts[:timestamp] )
67
+ Block.new( previous.index+1, transactions, previous.hash, timestamp: opts[:timestamp] )
68
68
  end
69
69
 
70
70
 
@@ -5,7 +5,7 @@ module BlockchainLite
5
5
 
6
6
  MAJOR = 1
7
7
  MINOR = 3
8
- PATCH = 0
8
+ PATCH = 1
9
9
  VERSION = [MAJOR,MINOR,PATCH].join('.')
10
10
 
11
11
  def self.version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blockchain-lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-20 00:00:00.000000000 Z
11
+ date: 2017-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: merkletree