cryptocoin_payable 1.4.1 → 1.4.2
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/lib/cryptocoin_payable/adapters/base.rb +2 -2
- data/lib/cryptocoin_payable/adapters/ethereum.rb +1 -1
- data/lib/cryptocoin_payable/version.rb +1 -1
- data/spec/acceptance/adapters/bitcoin_cash_spec.rb +5 -21
- data/spec/acceptance/adapters/bitcoin_spec.rb +5 -20
- data/spec/acceptance/adapters/ethereum_spec.rb +5 -20
- data/spec/spec_helper.rb +28 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9c3b769f3a1a510faae0a7eb1357530471055df
|
4
|
+
data.tar.gz: c487a992b551c4edd5eda5f4f0bc50fa9bec220c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a4c6be8ceb10155312af33f6d60a411cc50a13f2d59ab71acca9d8b0410ed10b0da69e023c2b4753458009d1f0f41f053bac058eb4911062c01471f07c1aa6f
|
7
|
+
data.tar.gz: 669858b08b8e41a333b2bd3263782b7d5ea1da19523d7a3226aa4569aa38ee439650d8a5e79090f063a23ec10fa7e8866c23816d71e9f2b002daf016195cd2ba
|
@@ -72,8 +72,8 @@ module CryptocoinPayable
|
|
72
72
|
@coin_config ||= CryptocoinPayable.configuration.send(self.class.coin_symbol.downcase)
|
73
73
|
end
|
74
74
|
|
75
|
-
def
|
76
|
-
@
|
75
|
+
def adapter_api_key
|
76
|
+
@adapter_api_key ||= coin_config && coin_config.adapter_api_key
|
77
77
|
end
|
78
78
|
|
79
79
|
def parse_timestamp(timestamp)
|
@@ -14,7 +14,7 @@ module CryptocoinPayable
|
|
14
14
|
|
15
15
|
def fetch_transactions(address)
|
16
16
|
url = "https://#{subdomain}.etherscan.io/api?module=account&action=txlist&address=#{address}&tag=latest"
|
17
|
-
url += '?apiKey=' +
|
17
|
+
url += '?apiKey=' + adapter_api_key if adapter_api_key
|
18
18
|
|
19
19
|
response = get_request(url)
|
20
20
|
json = JSON.parse(response.body)
|
@@ -28,27 +28,11 @@ describe CryptocoinPayable::Adapters::BitcoinCash, :vcr do
|
|
28
28
|
expect { subject.fetch_transactions('foo') }.to raise_error CryptocoinPayable::ApiError
|
29
29
|
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
# decline front canvas initial business fashion priority clay tribe
|
37
|
-
# praise'
|
38
|
-
# See https://iancoleman.io/bip39
|
39
|
-
# rubocop:disable Metrics/LineLength
|
40
|
-
bch_config.master_public_key = 'xpub69m5Zouf7QU8wRjLfQX2F5VtgyTNJ45Xy6xg6SbrynM5D31U7uowkwe55y569b5Aonz9LJySajB1qkdkhFCdLVQE6U51VB6aGMeejKafAET'
|
41
|
-
# rubocop:enable Metrics/LineLength
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
it 'creates BIP32 addresses' do
|
47
|
-
3.times do
|
48
|
-
expect(subject.create_address(0)).to eq('bitcoincash:qpfspf58t6vcsvq7xeumpuudqhvj38s5sus4uutspg')
|
49
|
-
expect(subject.create_address(1)).to eq('bitcoincash:qz94rwzlgccnkvaaea5klmtmad32l8gndgrcfwaryc')
|
50
|
-
expect(subject.create_address(2)).to eq('bitcoincash:qrgpwhl6x5qvf8ratcdl992r5afuv6286ujfa82xrh')
|
51
|
-
end
|
31
|
+
it 'creates BIP32 addresses' do
|
32
|
+
3.times do
|
33
|
+
expect(subject.create_address(0)).to eq('bitcoincash:qpfspf58t6vcsvq7xeumpuudqhvj38s5sus4uutspg')
|
34
|
+
expect(subject.create_address(1)).to eq('bitcoincash:qz94rwzlgccnkvaaea5klmtmad32l8gndgrcfwaryc')
|
35
|
+
expect(subject.create_address(2)).to eq('bitcoincash:qrgpwhl6x5qvf8ratcdl992r5afuv6286ujfa82xrh')
|
52
36
|
end
|
53
37
|
end
|
54
38
|
end
|
@@ -54,26 +54,11 @@ describe CryptocoinPayable::Adapters::Bitcoin, :vcr do
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
# inside tissue artist patrol evil turtle brass ivory'
|
63
|
-
# See https://iancoleman.io/bip39
|
64
|
-
# rubocop:disable Metrics/LineLength
|
65
|
-
btc_config.master_public_key = 'xpub688gtTMXY1ykq6RKrrSyVzGad7HTsTNVfT5UzyWL72fs73skbBFEuBfiYH5BhST5xzfUx7SFw5BF7jbJRDnxSjUtdfTS4Be9veEBdqZW1qg'
|
66
|
-
# rubocop:enable Metrics/LineLength
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
it 'creates BIP32 addresses' do
|
72
|
-
3.times do
|
73
|
-
expect(subject.create_address(0)).to eq('1D5qJDG6No5xcHovLmyNU1b3vq7xkEzTRH')
|
74
|
-
expect(subject.create_address(1)).to eq('17A91ZXzkJQkSrbNWcY8ywDC7D9aW9roKo')
|
75
|
-
expect(subject.create_address(2)).to eq('16Ak3B8ahHWbrZvukMUe8PUDLR5HScM6LK')
|
76
|
-
end
|
57
|
+
it 'creates BIP32 addresses' do
|
58
|
+
3.times do
|
59
|
+
expect(subject.create_address(0)).to eq('1D5qJDG6No5xcHovLmyNU1b3vq7xkEzTRH')
|
60
|
+
expect(subject.create_address(1)).to eq('17A91ZXzkJQkSrbNWcY8ywDC7D9aW9roKo')
|
61
|
+
expect(subject.create_address(2)).to eq('16Ak3B8ahHWbrZvukMUe8PUDLR5HScM6LK')
|
77
62
|
end
|
78
63
|
end
|
79
64
|
end
|
@@ -55,26 +55,11 @@ describe CryptocoinPayable::Adapters::Ethereum, :vcr do
|
|
55
55
|
expect { subject.fetch_transactions('foo') }.to raise_error CryptocoinPayable::ApiError
|
56
56
|
end
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
# soup wasp slice oxygen nominee anxiety step raven teach'
|
64
|
-
# See https://iancoleman.io/bip39
|
65
|
-
# rubocop:disable Metrics/LineLength
|
66
|
-
eth_config.master_public_key = 'xpub69AhsZVugHWJ2iwbrYYhJ79W1KsbzUqGuUHRuMguZGa8ZSP6qFNCpy8pvkCUDdc2hNfVFeJL2vxxdgaDxeBGXuWL5hUVfuE9tjDDbX4eRUh'
|
67
|
-
# rubocop:enable Metrics/LineLength
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
it 'creates BIP32 addresses' do
|
73
|
-
3.times do
|
74
|
-
expect(subject.create_address(0)).to eq('0xcDe321aCfa5B779dCD174850C3FB6E5Ff15cDEAf')
|
75
|
-
expect(subject.create_address(1)).to eq('0x0CA6E0C53EEb559c0D8803076D4F02b72f0FAE9C')
|
76
|
-
expect(subject.create_address(2)).to eq('0xD87D2476c93411242778fe0ef6e758De19ed19E8')
|
77
|
-
end
|
58
|
+
it 'creates BIP32 addresses' do
|
59
|
+
3.times do
|
60
|
+
expect(subject.create_address(0)).to eq('0xcDe321aCfa5B779dCD174850C3FB6E5Ff15cDEAf')
|
61
|
+
expect(subject.create_address(1)).to eq('0x0CA6E0C53EEb559c0D8803076D4F02b72f0FAE9C')
|
62
|
+
expect(subject.create_address(2)).to eq('0xD87D2476c93411242778fe0ef6e758De19ed19E8')
|
78
63
|
end
|
79
64
|
end
|
80
65
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -75,7 +75,34 @@ RSpec.configure do |config|
|
|
75
75
|
config.shared_context_metadata_behavior = :apply_to_host_groups
|
76
76
|
|
77
77
|
config.before(:suite) do
|
78
|
-
CryptocoinPayable.configure do
|
78
|
+
CryptocoinPayable.configure do |c|
|
79
|
+
c.configure_btc do |btc_config|
|
80
|
+
# Created using BIP39 mnemonic 'dose rug must junk rug spell bracket
|
81
|
+
# inside tissue artist patrol evil turtle brass ivory'
|
82
|
+
# See https://iancoleman.io/bip39
|
83
|
+
# rubocop:disable Metrics/LineLength
|
84
|
+
btc_config.master_public_key = 'xpub688gtTMXY1ykq6RKrrSyVzGad7HTsTNVfT5UzyWL72fs73skbBFEuBfiYH5BhST5xzfUx7SFw5BF7jbJRDnxSjUtdfTS4Be9veEBdqZW1qg'
|
85
|
+
# rubocop:enable Metrics/LineLength
|
86
|
+
end
|
87
|
+
|
88
|
+
c.configure_eth do |eth_config|
|
89
|
+
# Created using BIP39 mnemonic 'cute season foam off pistol interest
|
90
|
+
# soup wasp slice oxygen nominee anxiety step raven teach'
|
91
|
+
# See https://iancoleman.io/bip39
|
92
|
+
# rubocop:disable Metrics/LineLength
|
93
|
+
eth_config.master_public_key = 'xpub69AhsZVugHWJ2iwbrYYhJ79W1KsbzUqGuUHRuMguZGa8ZSP6qFNCpy8pvkCUDdc2hNfVFeJL2vxxdgaDxeBGXuWL5hUVfuE9tjDDbX4eRUh'
|
94
|
+
# rubocop:enable Metrics/LineLength
|
95
|
+
end
|
96
|
+
|
97
|
+
c.configure_bch do |bch_config|
|
98
|
+
# Created using BIP39 mnemonic 'over dentist endorse dial muscle
|
99
|
+
# decline front canvas initial business fashion priority clay tribe
|
100
|
+
# praise'
|
101
|
+
# See https://iancoleman.io/bip39
|
102
|
+
# rubocop:disable Metrics/LineLength
|
103
|
+
bch_config.master_public_key = 'xpub69m5Zouf7QU8wRjLfQX2F5VtgyTNJ45Xy6xg6SbrynM5D31U7uowkwe55y569b5Aonz9LJySajB1qkdkhFCdLVQE6U51VB6aGMeejKafAET'
|
104
|
+
# rubocop:enable Metrics/LineLength
|
105
|
+
end
|
79
106
|
end
|
80
107
|
|
81
108
|
ActiveRecord::Base.establish_connection(adapter: 'postgresql', database: 'cryptocoin_payable_test')
|
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.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Salis
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-10-
|
12
|
+
date: 2018-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -419,7 +419,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
419
419
|
version: 1.3.6
|
420
420
|
requirements: []
|
421
421
|
rubyforge_project:
|
422
|
-
rubygems_version: 2.6.
|
422
|
+
rubygems_version: 2.6.14
|
423
423
|
signing_key:
|
424
424
|
specification_version: 4
|
425
425
|
summary: Cryptocurrency payment processor
|