keoken 0.2.8 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardoc/checksums +11 -11
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/Gemfile.lock +4 -1
- data/doc/Bitcoin/Script.html +1 -1
- data/doc/Keoken/Backend/Base.html +67 -1
- data/doc/Keoken/Backend/BitcoinRuby/Transaction.html +2 -2
- data/doc/Keoken/Backend/BitcoinRuby.html +1 -1
- data/doc/Keoken/Backend/Trezor/Transaction.html +59 -27
- data/doc/Keoken/Backend/Trezor.html +1 -1
- data/doc/Keoken/Backend.html +1 -1
- data/doc/Keoken/Bitprim/Transaction.html +1 -1
- data/doc/Keoken/Bitprim.html +1 -1
- data/doc/Keoken/Error/DataNotParsed.html +202 -0
- data/doc/Keoken/Error/IdNotFound.html +202 -0
- data/doc/Keoken/Error/NameNotFound.html +202 -0
- data/doc/Keoken/Error/OutputNotFound.html +202 -0
- data/doc/Keoken/Error.html +117 -0
- data/doc/Keoken/Parser.html +1 -1
- data/doc/Keoken/Token.html +7 -7
- data/doc/Keoken.html +4 -4
- data/doc/_index.html +26 -11
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/method_list.html +18 -10
- data/doc/top-level-namespace.html +1 -1
- data/keoken.gemspec +1 -0
- data/lib/keoken/backend/trezor/transaction.rb +54 -24
- data/lib/keoken/version.rb +1 -1
- data/spec/keoken_spec.rb +81 -2
- metadata +20 -1
data/spec/keoken_spec.rb
CHANGED
@@ -210,8 +210,8 @@ describe Keoken do
|
|
210
210
|
expect(raw).to end_with('6a0400004b50100000000100000123000000000007a12000000000')
|
211
211
|
end
|
212
212
|
end
|
213
|
-
|
214
|
-
describe '
|
213
|
+
|
214
|
+
describe 'Trezor' do
|
215
215
|
it 'creates token' do
|
216
216
|
mock_requests
|
217
217
|
allow(ENV).to receive(:[]).with('KEOKEN_NODE').and_return('PRODUCTION')
|
@@ -246,6 +246,85 @@ describe Keoken do
|
|
246
246
|
)
|
247
247
|
)
|
248
248
|
end
|
249
|
+
|
250
|
+
it 'sends token' do
|
251
|
+
mock_requests
|
252
|
+
allow(ENV).to receive(:[]).with('KEOKEN_NODE').and_return('PRODUCTION')
|
253
|
+
token = Keoken::Token.new(id: 86)
|
254
|
+
token.send_amount(456_342)
|
255
|
+
script = token.hex
|
256
|
+
@transaction_token = Keoken::Backend::Trezor::Transaction.new
|
257
|
+
expect(
|
258
|
+
@transaction_token.build_for_send_amount(
|
259
|
+
'17wrMVCa9EJUVVEC3c5CZZanjT1NtWU2mX',
|
260
|
+
'32tM1kKxnTzcJugmGsavg5MnsJiNZfUUzQ',
|
261
|
+
[44, 145, 0, 0, 0],
|
262
|
+
script,
|
263
|
+
['ypub6WrVGzkKFeNTTppAVe2KkY3yiohKNvFDZm7qAFKBAu8ozm2DYRmwoXwpQUAaEbLkCJmdGaYBLxBUbJcfeLZcwXEtF9neUCDXuWtVyFDApi6',
|
264
|
+
'ypub6WtFU3UPzgvu1AJzw9Quw6TgNp7FM5ro2AZwcwmkgP4HvdurTiGRSDYKV4YaofGny96xFykeNxJGgt8SiNwhFnBbdmwyiiLVRxoKWTeQnuB']
|
265
|
+
)
|
266
|
+
).to(
|
267
|
+
eq(
|
268
|
+
inputs:
|
269
|
+
[
|
270
|
+
{
|
271
|
+
address_n: [44, 145, 0, 0, 0],
|
272
|
+
amount: '8985999',
|
273
|
+
multisig: {
|
274
|
+
m: 2,
|
275
|
+
pubkeys:
|
276
|
+
[
|
277
|
+
{
|
278
|
+
address_n: [44, 145, 0, 0, 0],
|
279
|
+
node:
|
280
|
+
{
|
281
|
+
chain_code: '7bd6545bf255444ba4cf93b893e56deacf59e0b8e065d44673e9afff4e3655c6',
|
282
|
+
child_num: 0,
|
283
|
+
depth: 0,
|
284
|
+
fingerprint: 0,
|
285
|
+
public_key: '03db551b0f0962d4cbbf15b6d81dd7dc0e82868867182ec15b1e5e28b90fac97c4'
|
286
|
+
}
|
287
|
+
},
|
288
|
+
{
|
289
|
+
address_n: [44, 145, 0, 0, 0],
|
290
|
+
node:
|
291
|
+
{
|
292
|
+
chain_code: '4199329ed001a33fb58fd75bac23c80c0d38cedc009bac8f89c89df91c35bc8e',
|
293
|
+
child_num: 0,
|
294
|
+
depth: 0,
|
295
|
+
fingerprint: 0,
|
296
|
+
public_key: '02408f31733a184b6d0dd52a0800bf1a6b02102b9bfcc9c158b508365869c8c73d'
|
297
|
+
}
|
298
|
+
}
|
299
|
+
],
|
300
|
+
signatures: ['', '', '']
|
301
|
+
},
|
302
|
+
prev_hash: '448a9356f6317eeaa9581f9a39d41431ac74aa2b73438c01e1d522543d14e8da',
|
303
|
+
prev_index: 1,
|
304
|
+
script_type: 'SPENDMULTISIG'
|
305
|
+
}
|
306
|
+
],
|
307
|
+
outputs:
|
308
|
+
[
|
309
|
+
{
|
310
|
+
address: 'bitcoincash:qpxrq63y6kz2wphm2nfsh6z23yvjmz7avcc5wsgruw',
|
311
|
+
amount: '8756231',
|
312
|
+
script_type: 'PAYTOADDRESS'
|
313
|
+
},
|
314
|
+
{
|
315
|
+
address: 'bitcoincash:pqx3eghuvc7kmc4qkwg0qwfjqyedh3wg8qkwanr9pd',
|
316
|
+
amount: '114884',
|
317
|
+
script_type: 'PAYTOADDRESS'
|
318
|
+
},
|
319
|
+
{
|
320
|
+
amount: '0',
|
321
|
+
op_return_data: '6a0400004b50100000000100000086000000000006f696',
|
322
|
+
script_type: 'PAYTOOPRETURN'
|
323
|
+
}
|
324
|
+
]
|
325
|
+
)
|
326
|
+
)
|
327
|
+
end
|
249
328
|
end
|
250
329
|
end
|
251
330
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: keoken
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bitex
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.0.18
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: money-tree
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.10.0
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.10.0
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -138,6 +152,11 @@ files:
|
|
138
152
|
- doc/Keoken/Bitprim.html
|
139
153
|
- doc/Keoken/Bitprim/Transaction.html
|
140
154
|
- doc/Keoken/DataNotParsed.html
|
155
|
+
- doc/Keoken/Error.html
|
156
|
+
- doc/Keoken/Error/DataNotParsed.html
|
157
|
+
- doc/Keoken/Error/IdNotFound.html
|
158
|
+
- doc/Keoken/Error/NameNotFound.html
|
159
|
+
- doc/Keoken/Error/OutputNotFound.html
|
141
160
|
- doc/Keoken/IdNotFound.html
|
142
161
|
- doc/Keoken/NameNotFound.html
|
143
162
|
- doc/Keoken/OutputNotFound.html
|