sibit 0.14.0 → 0.14.1

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
  SHA256:
3
- metadata.gz: 3f6e5104f2435ac68861792d65d9032cc0b41e3fd817e0aa78d0fac816498dfd
4
- data.tar.gz: ab243ba18cdb2d3b12cce59f610cc613f74a52cc5f1e231bce9079cd0793e894
3
+ metadata.gz: bd4e6a52e607ad9aa2101cd65545bc5002f530b493ddb2ba1abb33db17745f8a
4
+ data.tar.gz: 80086103804e4f181dc848e9b864327d2bfb467f2e2a1173ad1e3192d4156f25
5
5
  SHA512:
6
- metadata.gz: 8c213d7ab111da0b3e5e04b1ebb6493d6a51161b95c1cfa7390b16ab712c2db048c17d0bc05a2653579f0dd4bd7ea1dec9f77e63d7e580699233af1d39105fd8
7
- data.tar.gz: d165148dfdc656e97e672c98a1a9839d34214ef0c2484d795103aac45e15b026459cd3191fee1d9e336fc588e366c5f0b6bee8e458c8ae34d3eaed91ade7d3c3
6
+ metadata.gz: 24c6913f48638f43374e3f7c65efb1bc7df1c34714e9f1bf0939cf7cd47a3e9a1e6021de09db6cb528c7f12046b0d17d060153f548d0b92d4c1b614e8bf4642e
7
+ data.tar.gz: c7518ebc0681367f2983ae9ced5227479829c370b882e11280ea238703196e77550c6ce5e71f37e55b8e0a13e3a9565323b090a25346fdcd775c043761b1aac1
data/lib/sibit/fake.rb CHANGED
@@ -50,8 +50,24 @@ class Sibit
50
50
  '00000000000000000008df8a6e1b61d1136803ac9791b8725235c9f780b4ed71'
51
51
  end
52
52
 
53
- def get_json(_uri)
54
- {}
53
+ def block(hash)
54
+ {
55
+ hash: hash,
56
+ orphan: false,
57
+ next: hash,
58
+ previous: hash,
59
+ txns: [
60
+ {
61
+ hash: hash,
62
+ outputs: [
63
+ {
64
+ address: '1HqhZx8U18TYS5paraTM1MzUQWb7ZbcG9u',
65
+ value: 1000
66
+ }
67
+ ]
68
+ }
69
+ ]
70
+ }
55
71
  end
56
72
  end
57
73
  end
data/lib/sibit/version.rb CHANGED
@@ -26,5 +26,5 @@
26
26
  # License:: MIT
27
27
  class Sibit
28
28
  # Current version of the library.
29
- VERSION = '0.14.0'
29
+ VERSION = '0.14.1'
30
30
  end
data/sibit.gemspec CHANGED
@@ -50,6 +50,7 @@ and Ruby 2.3+.'
50
50
  s.extra_rdoc_files = ['README.md', 'LICENSE.txt']
51
51
  s.add_runtime_dependency 'backtrace', '~> 0.3'
52
52
  s.add_runtime_dependency 'bitcoin', '0.2.0'
53
+ s.add_runtime_dependency 'bitcoin-ruby', '0.0.19'
53
54
  s.add_runtime_dependency 'json', '~> 2'
54
55
  s.add_runtime_dependency 'retriable_proxy', '1.0.2'
55
56
  s.add_runtime_dependency 'slop', '~> 4.6'
data/test/test_fake.rb CHANGED
@@ -40,6 +40,19 @@ class TestFake < Minitest::Test
40
40
  sibit.pay(0, 'M', {}, '', '')
41
41
  )
42
42
  assert_equal('00000000000000000008df8a6e1b61d1136803ac9791b8725235c9f780b4ed71', sibit.latest)
43
- assert_equal({}, sibit.get_json('/'))
43
+ end
44
+
45
+ def test_scan_works
46
+ sibit = Sibit.new(api: Sibit::Fake.new)
47
+ hash = '1234567'
48
+ found = false
49
+ tail = sibit.scan(hash) do |addr, tx, satoshi|
50
+ assert_equal(1000, satoshi)
51
+ assert_equal('1HqhZx8U18TYS5paraTM1MzUQWb7ZbcG9u', addr)
52
+ assert_equal("#{hash}:0", tx)
53
+ found = true
54
+ end
55
+ assert(found)
56
+ assert_equal(hash, tail)
44
57
  end
45
58
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sibit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-23 00:00:00.000000000 Z
11
+ date: 2020-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: backtrace
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.2.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: bitcoin-ruby
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.0.19
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.0.19
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: json
43
57
  requirement: !ruby/object:Gem::Requirement