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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: e07acfcc044f767cc57922410b5d13ccd29cb9ac7e744f7c85bc20ed41d03563
4
- data.tar.gz: 8c5fdfd189aa4517704ad6c6df49b7387fb5a7464cf404d385bb63e93656903c
2
+ SHA1:
3
+ metadata.gz: b1d20582c06a5bde5731c062f61c038b828ee20d
4
+ data.tar.gz: c9f9c0e8f7226cbbc5864c8f231a144f2a12a265
5
5
  SHA512:
6
- metadata.gz: 22e1c08dd6cee4962c94b856f0231498e22ad21d126c81f8d2220a345701998b17a5b956ad1258e4ddeec5b86006158a99bce3fff762c8909dbd00cb7668fbfb
7
- data.tar.gz: 4a643c0c41b1b6bfaeb5eee574100475453b38c84a1f47d751154f7c9308e91a7e493838bd7a518cf6dc0ec32571dec241197deab71b931717cfd0012737f95f
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
- Keoken::PREFIX_BYTE_AMOUNT[0..prefix_length(amount)] + amount.to_s(16)
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
- Keoken::PREFIX_BYTE_ASSET_ID[0..(asset_length - 1)] + @id.to_s,
52
- Keoken::PREFIX_BYTE_AMOUNT[0..prefix_length(amount)] + amount.to_s(16)
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
@@ -1,3 +1,3 @@
1
1
  module Keoken
2
- VERSION = '0.3.1'.freeze
2
+ VERSION = '0.3.2'.freeze
3
3
  end
data/lib/keoken.rb CHANGED
@@ -19,8 +19,6 @@ module Keoken
19
19
  VERSION_NODE = '0000'.freeze
20
20
  TYPE_CREATE_ASSET = '0000'.freeze
21
21
  TYPE_SEND_TOKEN = '0001'.freeze
22
- PREFIX_BYTE_AMOUNT = '0000000000000000'.freeze
23
22
  AMOUNT_SIZE = 16
24
- PREFIX_BYTE_ASSET_ID = '00000000'.freeze
25
23
  ASSET_ID_SIZE = 8
26
24
  end
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('6a0400004b5010000000010000003400000000000f4240')
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 0000000100000123000000000007a120'
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('6a0400004b50100000000100000123000000000007a12000000000')
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: '6a0400004b50100000000100000086000000000006f696',
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.1
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.7.7
216
+ rubygems_version: 2.4.8
217
217
  signing_key:
218
218
  specification_version: 4
219
219
  summary: Keoken protocol implemented in Ruby