keoken 0.3.1 → 0.3.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 +5 -5
- data/lib/keoken/token.rb +3 -3
- data/lib/keoken/version.rb +1 -1
- data/lib/keoken.rb +0 -2
- data/spec/keoken_spec.rb +4 -6
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: b1d20582c06a5bde5731c062f61c038b828ee20d
|
|
4
|
+
data.tar.gz: c9f9c0e8f7226cbbc5864c8f231a144f2a12a265
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 09840e38ffc0e34cf915bae18f7da07dfa030f0d6d59285ac0dfee6e92cff6fcd815952d1afe6cb30c07bc768abfdec704123aaf6567d713f2d0969924d22117
|
|
7
|
+
data.tar.gz: c46649ec6d06f1716a72c1b46d77b44f517a4f4f0d1e131425cdd5563e5f72308cc84a00271fa62cbe8fb39fbc6dbcefb0bba8b04b675ae0dc9719f47fb916dc
|
data/lib/keoken/token.rb
CHANGED
|
@@ -30,7 +30,7 @@ module Keoken
|
|
|
30
30
|
Keoken::VERSION_NODE,
|
|
31
31
|
Keoken::TYPE_CREATE_ASSET,
|
|
32
32
|
name_to_hex(@name),
|
|
33
|
-
|
|
33
|
+
[amount.to_i].pack('q>').unpack('H*')
|
|
34
34
|
].flatten.join
|
|
35
35
|
self
|
|
36
36
|
end
|
|
@@ -48,8 +48,8 @@ module Keoken
|
|
|
48
48
|
[
|
|
49
49
|
Keoken::VERSION_NODE,
|
|
50
50
|
Keoken::TYPE_SEND_TOKEN,
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
[@id.to_i].pack('L>').unpack('H*'),
|
|
52
|
+
[amount.to_i].pack('q>').unpack('H*')
|
|
53
53
|
].flatten.join
|
|
54
54
|
self
|
|
55
55
|
end
|
data/lib/keoken/version.rb
CHANGED
data/lib/keoken.rb
CHANGED
data/spec/keoken_spec.rb
CHANGED
|
@@ -11,9 +11,7 @@ describe Keoken do
|
|
|
11
11
|
expect(Keoken::VERSION_NODE).not_to be nil
|
|
12
12
|
expect(Keoken::TYPE_CREATE_ASSET).not_to be nil
|
|
13
13
|
expect(Keoken::TYPE_SEND_TOKEN).not_to be nil
|
|
14
|
-
expect(Keoken::PREFIX_BYTE_AMOUNT).not_to be nil
|
|
15
14
|
expect(Keoken::AMOUNT_SIZE).not_to be nil
|
|
16
|
-
expect(Keoken::PREFIX_BYTE_ASSET_ID).not_to be nil
|
|
17
15
|
expect(Keoken::ASSET_ID_SIZE).not_to be nil
|
|
18
16
|
end
|
|
19
17
|
|
|
@@ -55,7 +53,7 @@ describe Keoken do
|
|
|
55
53
|
token = Keoken::Token.new(id: 34)
|
|
56
54
|
token.send_amount(1_000_000)
|
|
57
55
|
expect(token.hex).to(
|
|
58
|
-
eq('
|
|
56
|
+
eq('6a0400004b5010000000010000002200000000000f4240')
|
|
59
57
|
)
|
|
60
58
|
end
|
|
61
59
|
|
|
@@ -197,7 +195,7 @@ describe Keoken do
|
|
|
197
195
|
},
|
|
198
196
|
{
|
|
199
197
|
'value' => '0.00000000',
|
|
200
|
-
'scriptPubKey' => 'OP_RETURN 00004b50
|
|
198
|
+
'scriptPubKey' => 'OP_RETURN 00004b50 000000010000007b000000000007a120'
|
|
201
199
|
}
|
|
202
200
|
]
|
|
203
201
|
)
|
|
@@ -207,7 +205,7 @@ describe Keoken do
|
|
|
207
205
|
it 'raw transaction' do
|
|
208
206
|
raw = @transaction_token.raw
|
|
209
207
|
expect(raw).to start_with('0100000001dae8143d5422d5e1018c43732baa74ac3114d4399a1f58a9ea7e31f656938a4401000000')
|
|
210
|
-
expect(raw).to end_with('
|
|
208
|
+
expect(raw).to end_with('6a0400004b5010000000010000007b000000000007a12000000000')
|
|
211
209
|
end
|
|
212
210
|
end
|
|
213
211
|
|
|
@@ -318,7 +316,7 @@ describe Keoken do
|
|
|
318
316
|
},
|
|
319
317
|
{
|
|
320
318
|
amount: '0',
|
|
321
|
-
op_return_data: '
|
|
319
|
+
op_return_data: '6a0400004b50100000000100000056000000000006f696',
|
|
322
320
|
script_type: 'PAYTOOPRETURN'
|
|
323
321
|
}
|
|
324
322
|
]
|
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.3.
|
|
4
|
+
version: 0.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bitex
|
|
@@ -213,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
213
213
|
version: '0'
|
|
214
214
|
requirements: []
|
|
215
215
|
rubyforge_project:
|
|
216
|
-
rubygems_version: 2.
|
|
216
|
+
rubygems_version: 2.4.8
|
|
217
217
|
signing_key:
|
|
218
218
|
specification_version: 4
|
|
219
219
|
summary: Keoken protocol implemented in Ruby
|