cryptocoin_payable 1.0.1 → 1.1.0
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 +4 -4
- data/.travis.yml +0 -2
- data/README.md +1 -0
- data/cryptocoin_payable.gemspec +1 -0
- data/lib/cryptocoin_payable/adapters/ethereum.rb +1 -1
- data/lib/cryptocoin_payable/version.rb +1 -1
- data/spec/acceptance/adapters/ethereum_spec.rb +11 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88f7a3d37e5fea6dfc2e08eec657a47c1c21e300
|
4
|
+
data.tar.gz: e17ae020453e6ccb0fff510f33dd11752f1869c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddcf94b0a53ea8dd77207c4d2827ca277bbd8e952b68bbb41b55ffa31849ff4167b4f2e6d6321ad811c506a0be13ca091e4cb546d02d93f32df13e2987077f5a
|
7
|
+
data.tar.gz: 1dfe1240bc30c549041c6664785860320330dc1f179408b4383beca9fd4f466efaa225aaa9c644b4eef0900559eae69b8373be05150f7e2e2ba659872333027c
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
[](https://badge.fury.io/rb/cryptocoin_payable)
|
2
|
+
[](https://travis-ci.com/mhluska/cryptocoin_payable)
|
2
3
|
|
3
4
|
# Cryptocoin Payable
|
4
5
|
|
data/cryptocoin_payable.gemspec
CHANGED
@@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
spec.required_rubygems_version = '>= 1.3.6'
|
21
|
+
spec.required_ruby_version = '>= 2.2.0'
|
21
22
|
|
22
23
|
spec.add_development_dependency 'activerecord', '~> 5.1'
|
23
24
|
spec.add_development_dependency 'bundler', '~> 1.15'
|
@@ -67,7 +67,7 @@ module CryptocoinPayable
|
|
67
67
|
tx_hash: transaction['hash'],
|
68
68
|
block_hash: transaction['block_hash'],
|
69
69
|
block_time: nil, # Not supported
|
70
|
-
estimated_tx_time:
|
70
|
+
estimated_tx_time: parse_timestamp(transaction['timeStamp']),
|
71
71
|
estimated_tx_value: transaction['value'].to_i, # Units here are 'Wei'
|
72
72
|
confirmations: transaction['confirmations'].to_i
|
73
73
|
}
|
@@ -2,16 +2,14 @@ require 'active_record'
|
|
2
2
|
require 'cryptocoin_payable'
|
3
3
|
|
4
4
|
describe CryptocoinPayable::Adapters::Ethereum, :vcr do
|
5
|
-
|
6
|
-
response
|
7
|
-
|
8
|
-
expect(response).to eq(
|
5
|
+
def expect_transaction_result(response)
|
6
|
+
expect(response).to match_array(
|
9
7
|
[
|
10
8
|
{
|
11
9
|
tx_hash: '0xa88b799514e9621962e3d0de25e7e0bc7a123e33085f322c7acdb99cc2585c6d',
|
12
10
|
block_hash: '0x752c50e426f65820f5bf6fd49acbb08d79464f8e7e8ea5b77e2299b69fd6398b',
|
13
11
|
block_time: nil,
|
14
|
-
estimated_tx_time: '2018-07-05T12:58:33+07:00',
|
12
|
+
estimated_tx_time: be_within(1.day).of(DateTime.iso8601('2018-07-05T12:58:33.000000000+07:00')),
|
15
13
|
estimated_tx_value: 33_753_640_000_000_000,
|
16
14
|
confirmations: 569_771
|
17
15
|
},
|
@@ -19,7 +17,7 @@ describe CryptocoinPayable::Adapters::Ethereum, :vcr do
|
|
19
17
|
tx_hash: '0xb325a8cf241f332bca92c7f715987e4d34be9a6b3bb78d2425c83086b4aced26',
|
20
18
|
block_hash: '0x1c2b73a16fd8c4d25feeccaa2f0bf5c82b8f415f1beaf4d34aaf870daf89689d',
|
21
19
|
block_time: nil,
|
22
|
-
estimated_tx_time: '2018-07-05T13:35:07+07:00',
|
20
|
+
estimated_tx_time: be_within(1.day).of(DateTime.iso8601('2018-07-05T13:35:07.000000000+07:00')),
|
23
21
|
estimated_tx_value: 2_190_144_444_444_444,
|
24
22
|
confirmations: 569_629
|
25
23
|
},
|
@@ -27,7 +25,7 @@ describe CryptocoinPayable::Adapters::Ethereum, :vcr do
|
|
27
25
|
tx_hash: '0xcd874917be5ad177e7ebd88b5c4a7d4283796e00e43345da5b63fb4f78130b37',
|
28
26
|
block_hash: '0x4ce71d11146445f123680ea9beba7db968b04dc675caddf60248c9d9d6f5739e',
|
29
27
|
block_time: nil,
|
30
|
-
estimated_tx_time: '2018-07-05T13:55:53+07:00',
|
28
|
+
estimated_tx_time: be_within(1.day).of(DateTime.iso8601('2018-07-05T13:55:53.000000000+07:00')),
|
31
29
|
estimated_tx_value: 1_007_518_888_888_888,
|
32
30
|
confirmations: 569_549
|
33
31
|
},
|
@@ -35,7 +33,7 @@ describe CryptocoinPayable::Adapters::Ethereum, :vcr do
|
|
35
33
|
tx_hash: '0x799ec2aaafbddbc2e746334f96f59f6127dec62e5693480576db351aaf840bfb',
|
36
34
|
block_hash: '0xc1361b19b2266e2259ac433b9e18b4fbc81339304988bbc62dd93aa24fac6449',
|
37
35
|
block_time: nil,
|
38
|
-
estimated_tx_time: '2018-08-26T16:05:44+07:00',
|
36
|
+
estimated_tx_time: be_within(1.day).of(DateTime.iso8601('2018-08-26T16:05:44.000000000+07:00')),
|
39
37
|
estimated_tx_value: 15_678_420_000_000_000,
|
40
38
|
confirmations: 261_969
|
41
39
|
}
|
@@ -43,6 +41,11 @@ describe CryptocoinPayable::Adapters::Ethereum, :vcr do
|
|
43
41
|
)
|
44
42
|
end
|
45
43
|
|
44
|
+
it 'gets transactions for a given address' do
|
45
|
+
response = subject.fetch_transactions('0xfc8cfb26c31931572e65e450f7fa498bcc11651c')
|
46
|
+
expect_transaction_result(response)
|
47
|
+
end
|
48
|
+
|
46
49
|
it 'gets an empty result when no transactions found' do
|
47
50
|
response = subject.fetch_transactions('0x772fDD41BFB34C9903B253322baccdbE2C10851e')
|
48
51
|
expect(response).to eq([])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryptocoin_payable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Salis
|
@@ -345,7 +345,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
345
345
|
requirements:
|
346
346
|
- - ">="
|
347
347
|
- !ruby/object:Gem::Version
|
348
|
-
version:
|
348
|
+
version: 2.2.0
|
349
349
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
350
350
|
requirements:
|
351
351
|
- - ">="
|