tierion 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b96becbb97f59db9528c8ab605507dbd4c7d45fe
4
- data.tar.gz: 2ac8b5c71e817e92fae8654f54823d250dc4ebe8
3
+ metadata.gz: f55bc79b03b76dea30f01803ea139dee262fee6d
4
+ data.tar.gz: 10250a419d07b51a09a12a0740c360019ea3d30a
5
5
  SHA512:
6
- metadata.gz: cc52a5336bcc9092391c0a544ad432400de3baa9486ca1613f3d91b0ad65cf76389da4e55a90b42707876c2609d8dd3c28eab1fe57da2a9a56ef9feb0c396d85
7
- data.tar.gz: 3f23fa5db012de8031cc8c34acdae3d3b2d282f5ce936fabefd3b5713f3eb58a0a8fd726081a1819260924d28864c482b96b9a3421be6a9e2bf83d7accc3763a
6
+ metadata.gz: 702bc8b1cb1243dac2cc37d6082731bd03c645c134954258ff5ee821c474042c78953a2e8a26f2b08695084766540de8c82d23fa9b7481e503ee9f3880d89ead
7
+ data.tar.gz: dbce99a7106c62aacec621af5b4ab7f8918143fd0e2db99aab662fb70b442e9f3052304c2bdcf00ac411fc9aa1d995b6f509a91d13d239236a160603a608fdb2
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## v1.2.0 (8/8/2016)
4
+
5
+ - Added `Client#receipt_from_id_and_hash` convenience method
6
+
3
7
  ## v1.1.0 (8/6/2016)
4
8
 
5
9
  - Added `Receipt#valid?` method to verify Merkle tree proof.
data/README.md CHANGED
@@ -98,6 +98,15 @@ an arg to `Client#receipt`
98
98
  => Tierion::HashApi::Receipt ...
99
99
  ```
100
100
 
101
+ You can also retrieve an individual receipt later as long as
102
+ you have the receipt ID and the original SHA256 hash used to
103
+ create it:
104
+
105
+ ```
106
+ > t.receipt_from_id_and_hash('your_receipt_id', 'your_sha256_hash')
107
+ => Tierion::HashApi::Receipt ...
108
+ ```
109
+
101
110
  Or, call `Client#receipts` to loop through each `Hashitem`
102
111
  submitted in this session and collect and cache `Receipts`
103
112
  for each from the API.
@@ -253,9 +262,6 @@ interactive prompt that will allow you to experiment.
253
262
 
254
263
  To install this gem onto your local machine, run `bundle exec rake install`.
255
264
 
256
- You can run the Command Line Interface (CLI) in development
257
- with `bundle exec exe/tierion`. (TODO : Implement CLI)
258
-
259
265
  The formal release process can be found in [RELEASE.md](https://github.com/grempe/tierion/blob/master/RELEASE.md)
260
266
 
261
267
  ## Contributing
@@ -99,16 +99,23 @@ module Tierion
99
99
  if h.hash == r.targetHash && r.valid?
100
100
  return r
101
101
  else
102
- raise 'Invalid Receipt returned'
102
+ raise 'Invalid Receipt. Merkle tree proof validation failed.'
103
103
  end
104
104
  else
105
- raise 'Invalid Receipt found'
105
+ raise 'Invalid Receipt. Missing type key. Old chainpoint?'
106
106
  end
107
107
  else
108
108
  return nil
109
109
  end
110
110
  end
111
111
 
112
+ # Retrieve a receipt from its HashItem#id and the original SHA256 hash
113
+ # used to create that HashItem.
114
+ def receipt_from_id_and_hash(id, hash)
115
+ hi = Tierion::HashApi::HashItem.new(id: id, hash: hash, timestamp: Time.now.utc.to_i)
116
+ receipt(hi)
117
+ end
118
+
112
119
  def logged_in?
113
120
  @access_token.present? &&
114
121
  @refresh_token.present? &&
@@ -1,3 +1,3 @@
1
1
  module Tierion
2
- VERSION = '1.1.0'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tierion
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glenn Rempe
@@ -30,7 +30,7 @@ cert_chain:
30
30
  zieXiXZSAojfFx9g91fKdIrlPbInHU/BaCxXSLBwvOM0drE+c2ue9X8gB55XAhzX
31
31
  37oBiw==
32
32
  -----END CERTIFICATE-----
33
- date: 2016-08-07 00:00:00.000000000 Z
33
+ date: 2016-08-08 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: httparty
metadata.gz.sig CHANGED
Binary file