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 +4 -4
- data/lib/sibit/fake.rb +18 -2
- data/lib/sibit/version.rb +1 -1
- data/sibit.gemspec +1 -0
- data/test/test_fake.rb +14 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd4e6a52e607ad9aa2101cd65545bc5002f530b493ddb2ba1abb33db17745f8a
|
4
|
+
data.tar.gz: 80086103804e4f181dc848e9b864327d2bfb467f2e2a1173ad1e3192d4156f25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
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
|
-
|
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.
|
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-
|
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
|