tezos_client 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -5
- data/Gemfile.lock +1 -1
- data/README.md +13 -35
- data/lib/tezos_client/logger.rb +1 -1
- data/lib/tezos_client/tools/annots_to_type.rb +31 -8
- data/lib/tezos_client/tools/convert_to_hash/base.rb +1 -1
- data/lib/tezos_client/tools/hash_to_micheline.rb +12 -60
- data/lib/tezos_client/tools/hash_to_micheline/address.rb +14 -0
- data/lib/tezos_client/tools/hash_to_micheline/base.rb +52 -0
- data/lib/tezos_client/tools/hash_to_micheline/bytes.rb +14 -0
- data/lib/tezos_client/tools/hash_to_micheline/contract.rb +14 -0
- data/lib/tezos_client/tools/hash_to_micheline/int.rb +13 -0
- data/lib/tezos_client/tools/hash_to_micheline/key.rb +14 -0
- data/lib/tezos_client/tools/hash_to_micheline/nat.rb +13 -0
- data/lib/tezos_client/tools/hash_to_micheline/option.rb +23 -0
- data/lib/tezos_client/tools/hash_to_micheline/pair.rb +45 -0
- data/lib/tezos_client/tools/hash_to_micheline/signature.rb +14 -0
- data/lib/tezos_client/tools/hash_to_micheline/string.rb +14 -0
- data/lib/tezos_client/tools/hash_to_micheline/timestamp.rb +14 -0
- data/lib/tezos_client/version.rb +1 -1
- data/travis-scripts/prepare-ubuntu.sh +6 -1
- metadata +15 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 52e7b70d781942af2a66c3db62098d68541585a00afa73c09e24993d16e3c426
|
4
|
+
data.tar.gz: 8aa477e4e46f96584904c5d6dc625545dc6a606f69225969ac4b5efc472c5573
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a1f456ca8177be6127e90da3c2ca964361180e2ca6b2f1d81f6875124ce9a1e8e8f512476d4470d9d0821078be5c42d1382bd5e761fed4f1a8ce95c0eb2c535
|
7
|
+
data.tar.gz: b9ec354b6fdba9e4f1eabe5265ffa68966c2035e11900b09ca2f7d501890fe2b7abb99a693b2b8cfe16df83453d8c677f27bc657f157622db4a5e3f02986ccb2
|
data/.travis.yml
CHANGED
@@ -13,11 +13,8 @@ rvm:
|
|
13
13
|
before_install:
|
14
14
|
- sh travis-scripts/prepare-ubuntu.sh
|
15
15
|
- mkdir -p $HOME/bin
|
16
|
-
- curl -s https://smartpy.io/
|
17
|
-
-
|
18
|
-
- ./SmartPy.sh local-install-auto $HOME/bin/smartpy/cli
|
19
|
-
- rm ./SmartPy.sh
|
20
|
-
- export PATH="$PATH:$HOME/bin/:$HOME/bin/smartpy/cli/"
|
16
|
+
- curl -s https://smartpy.io/cli/install.sh > SmartPyInstaller.sh && yes | sh SmartPyInstaller.sh
|
17
|
+
- export PATH="$PATH:$HOME/bin/:$HOME/smartpy-cli/"
|
21
18
|
- npm link michelson-to-micheline
|
22
19
|
- gem install bundler -v 1.16.3
|
23
20
|
script:
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -4,11 +4,12 @@
|
|
4
4
|
|
5
5
|
[![Build Status](https://travis-ci.org/moneytrackio/tezos_client.svg?branch=master)](https://travis-ci.org/moneytrackio/tezos_client)
|
6
6
|
|
7
|
-
Tezos Client
|
7
|
+
Tezos Client interacts with Tezos nodes using RPC commands.
|
8
8
|
|
9
|
-
## Requirements
|
10
|
-
|
11
|
-
|
9
|
+
## Requirements
|
10
|
+
|
11
|
+
Tezos client requires SmartPy to be installed in order to work properly.
|
12
|
+
To install it on Linux, you can basically follow the steps coded in travis-script folder.
|
12
13
|
|
13
14
|
## Dependency
|
14
15
|
|
@@ -18,11 +19,6 @@ sudo apt-get install nodejs
|
|
18
19
|
npm i -g michelson-to-micheline
|
19
20
|
```
|
20
21
|
|
21
|
-
### liquidity
|
22
|
-
[liquidity installation](http://www.liquidity-lang.org/doc/installation/index.html)
|
23
|
-
|
24
|
-
need the tezos version (not Dune version)
|
25
|
-
|
26
22
|
### SmartPy
|
27
23
|
[SmartPy](https://smartpy.io/)
|
28
24
|
|
@@ -54,9 +50,10 @@ Or install it yourself as:
|
|
54
50
|
|
55
51
|
## Usage
|
56
52
|
|
57
|
-
### Generate Tezos key
|
53
|
+
### Generate Tezos key pairs
|
54
|
+
|
55
|
+
Generate a perfectly random key pair:
|
58
56
|
|
59
|
-
Generate a prefectly random key pair:
|
60
57
|
```ruby
|
61
58
|
client = TezosClient.new
|
62
59
|
key = subject.generate_key
|
@@ -69,6 +66,7 @@ key = subject.generate_key
|
|
69
66
|
```
|
70
67
|
|
71
68
|
Generate a key pair from a seed and a BIP 44 Path:
|
69
|
+
|
72
70
|
```ruby
|
73
71
|
key = subject.generate_key(wallet_seed:"000102030405060708090a0b0c0d0e0f", path: "m/44'/1729'/0'/0'/0'")
|
74
72
|
expect(key[:address]).to eq "tz1RfnzRopJXH32SSDap2wMYGULBAnmHxdP1"
|
@@ -78,7 +76,8 @@ key = subject.generate_key(wallet_seed:"000102030405060708090a0b0c0d0e0f", path:
|
|
78
76
|
# :address=>"tz1a97x7GAvMDyrwwKTLQo131CoidXyUef48"
|
79
77
|
# }
|
80
78
|
```
|
81
|
-
Generate a key pair from a
|
79
|
+
Generate a key pair from a BIP-39 mnemonic sentence and a BIP 44 Path:
|
80
|
+
|
82
81
|
```ruby
|
83
82
|
key = subject.generate_key(
|
84
83
|
mnemonic: "below dove cushion divide future artefact orange congress maple fiscal flower enable",
|
@@ -118,28 +117,6 @@ client.transfer(
|
|
118
117
|
)
|
119
118
|
```
|
120
119
|
|
121
|
-
### Originate a contract written in liquidity
|
122
|
-
|
123
|
-
```ruby
|
124
|
-
script = File.expand_path("./spec/fixtures/demo.py")
|
125
|
-
source = "tz1ZWiiPXowuhN1UqNGVTrgNyf5tdxp4XUUq"
|
126
|
-
secret_key = "edsk4EcqupPmaebat5mP57ZQ3zo8NDkwv8vQmafdYZyeXxrSc72pjN"
|
127
|
-
amount = 0
|
128
|
-
init_params= "MyContract()"
|
129
|
-
client = TezosClient.new
|
130
|
-
|
131
|
-
res = client.originate_contract(
|
132
|
-
from: source,
|
133
|
-
amount: amount,
|
134
|
-
script: script,
|
135
|
-
secret_key: secret_key,
|
136
|
-
init_params: init_params
|
137
|
-
)
|
138
|
-
|
139
|
-
puts "Origination operation: #{res[:operation_id]}"
|
140
|
-
puts "Contract address: #{res[:originated_contract]}"
|
141
|
-
```
|
142
|
-
|
143
120
|
### Originate a contract written in SmartPy
|
144
121
|
|
145
122
|
```ruby
|
@@ -147,7 +124,7 @@ script = File.expand_path("./spec/fixtures/demo.py")
|
|
147
124
|
source = "tz1ZWiiPXowuhN1UqNGVTrgNyf5tdxp4XUUq"
|
148
125
|
secret_key = "edsk4EcqupPmaebat5mP57ZQ3zo8NDkwv8vQmafdYZyeXxrSc72pjN"
|
149
126
|
amount = 0
|
150
|
-
init_params
|
127
|
+
init_params= "MyContract()"
|
151
128
|
client = TezosClient.new
|
152
129
|
|
153
130
|
res = client.originate_contract(
|
@@ -163,6 +140,7 @@ puts "Contract address: #{res[:originated_contract]}"
|
|
163
140
|
```
|
164
141
|
|
165
142
|
### Call a contract written in SmartPy
|
143
|
+
|
166
144
|
```ruby
|
167
145
|
TezosClient.new.call_contract(
|
168
146
|
from: "tz1ZWiiPXowuhN1UqNGVTrgNyf5tdxp4XUUq",
|
data/lib/tezos_client/logger.rb
CHANGED
@@ -13,7 +13,7 @@ class TezosClient
|
|
13
13
|
self.class.logger << out + "\n"
|
14
14
|
end
|
15
15
|
|
16
|
-
FILTERED_KEYS = [:code, :contractCode]
|
16
|
+
FILTERED_KEYS = [:code, :contractCode, :contract_code]
|
17
17
|
def tezos_contents_log_filter(content)
|
18
18
|
if content.is_a? Array
|
19
19
|
content.map { |el| tezos_contents_log_filter(el) }
|
@@ -11,6 +11,17 @@ class TezosClient::Tools::AnnotsToType < ActiveInteraction::Base
|
|
11
11
|
|
12
12
|
validate :validate_types
|
13
13
|
|
14
|
+
TYPES_MAPPING = {
|
15
|
+
int: :int,
|
16
|
+
nat: :int,
|
17
|
+
string: :string,
|
18
|
+
signature: :string,
|
19
|
+
bytes: :bytes,
|
20
|
+
timestamp: :int,
|
21
|
+
key: :string,
|
22
|
+
address: :string
|
23
|
+
}.freeze
|
24
|
+
|
14
25
|
def execute
|
15
26
|
return { "prim" => typed_annots.values.first } if typed_annots.size == 1
|
16
27
|
|
@@ -18,16 +29,28 @@ class TezosClient::Tools::AnnotsToType < ActiveInteraction::Base
|
|
18
29
|
end
|
19
30
|
|
20
31
|
private
|
32
|
+
def micheline_type(annot_type, annot)
|
33
|
+
if annot_type.to_s.start_with?("optional_")
|
34
|
+
{
|
35
|
+
"prim" => "option",
|
36
|
+
"args" => [{ "prim" => annot_type.to_s.delete_prefix("optional_") }],
|
37
|
+
"annots" => ["%#{annot}"]
|
38
|
+
}
|
39
|
+
else
|
40
|
+
{
|
41
|
+
"prim" => annot_type,
|
42
|
+
"annots" => ["%#{annot}"]
|
43
|
+
}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
21
47
|
def generate_type_args(annots)
|
22
48
|
annot = annots.pop
|
23
49
|
annot_type = typed_annots[annot]
|
24
50
|
|
25
51
|
unless annots.size == 1
|
26
52
|
return [
|
27
|
-
|
28
|
-
"prim" => annot_type,
|
29
|
-
"annots" => ["%#{annot}"]
|
30
|
-
},
|
53
|
+
micheline_type(annot_type, annot),
|
31
54
|
{
|
32
55
|
"prim" => "pair",
|
33
56
|
"args" => generate_type_args(annots)
|
@@ -35,10 +58,10 @@ class TezosClient::Tools::AnnotsToType < ActiveInteraction::Base
|
|
35
58
|
]
|
36
59
|
end
|
37
60
|
|
38
|
-
generated_args = [
|
61
|
+
generated_args = [micheline_type(annot_type, annot)]
|
39
62
|
annot = annots.pop
|
40
63
|
annot_type = typed_annots[annot]
|
41
|
-
generated_args.append(
|
64
|
+
generated_args.append(micheline_type(annot_type, annot))
|
42
65
|
|
43
66
|
generated_args
|
44
67
|
end
|
@@ -48,8 +71,8 @@ class TezosClient::Tools::AnnotsToType < ActiveInteraction::Base
|
|
48
71
|
end
|
49
72
|
|
50
73
|
def validate_types
|
51
|
-
allowed_types =
|
52
|
-
return if typed_annots.values.map(
|
74
|
+
allowed_types = TYPES_MAPPING.keys
|
75
|
+
return if typed_annots.values.map{|type| type.to_s.delete_prefix("optional_").to_sym}.all? { |type| type.in? allowed_types }
|
53
76
|
|
54
77
|
errors.add(:base, "The allowed types are: #{allowed_types.join(', ')}")
|
55
78
|
end
|
@@ -1,18 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
int: :int,
|
7
|
-
nat: :int,
|
8
|
-
string: :string,
|
9
|
-
signature: :string,
|
10
|
-
bytes: :bytes,
|
11
|
-
timestamp: :int,
|
12
|
-
key: :string,
|
13
|
-
address: :string
|
14
|
-
}.freeze
|
3
|
+
require_relative "hash_to_micheline/base"
|
4
|
+
|
5
|
+
Dir[File.join(__dir__, "hash_to_micheline", "*.rb")].each { |file| require file }
|
15
6
|
|
7
|
+
|
8
|
+
class TezosClient::Tools::HashToMicheline < ActiveInteraction::Base
|
16
9
|
string :contract_address, default: nil
|
17
10
|
string :entrypoint, default: nil
|
18
11
|
# example of params:
|
@@ -20,7 +13,7 @@ class TezosClient::Tools::HashToMicheline < ActiveInteraction::Base
|
|
20
13
|
# spending_ref: "toto",
|
21
14
|
# expires_at: Time.now
|
22
15
|
# }
|
23
|
-
|
16
|
+
interface :params
|
24
17
|
hash :storage_type, strip: false, default: {}
|
25
18
|
interface :blockchain_client, methods: %i[entrypoint entrypoints select_entrypoint], default: -> { TezosClient.new }
|
26
19
|
|
@@ -29,59 +22,18 @@ class TezosClient::Tools::HashToMicheline < ActiveInteraction::Base
|
|
29
22
|
validate :storage_type_or_contract_address_presence
|
30
23
|
|
31
24
|
def execute
|
32
|
-
|
33
|
-
|
34
|
-
{ prim: "Pair", args: generate_micheline(_storage_type[:args]) }
|
25
|
+
TezosClient::Tools::HashToMicheline::Base.new(data: _params, type: _storage_type).value
|
35
26
|
end
|
36
27
|
|
37
28
|
private
|
38
|
-
def
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
if h[:prim] == "option"
|
45
|
-
value = params.fetch(annot)
|
46
|
-
if value
|
47
|
-
acc << {
|
48
|
-
"prim": "Some",
|
49
|
-
"args": [
|
50
|
-
hash_type_to_hash_data(h[:args][0][:prim], params.fetch(annot))
|
51
|
-
]
|
52
|
-
}
|
53
|
-
else
|
54
|
-
acc << {
|
55
|
-
"prim": "None"
|
56
|
-
}
|
57
|
-
end
|
58
|
-
else
|
59
|
-
acc << hash_type_to_hash_data(h[:prim], params.fetch(annot))
|
60
|
-
end
|
29
|
+
def _params
|
30
|
+
if params.respond_to?(:keys) && params.keys.size == 1 && !_storage_type.key?(:annots)
|
31
|
+
params.values.first
|
32
|
+
else
|
33
|
+
params
|
61
34
|
end
|
62
35
|
end
|
63
36
|
|
64
|
-
def convert_type(michelson_type)
|
65
|
-
TYPES_MAPPING.fetch(michelson_type.to_sym)
|
66
|
-
end
|
67
|
-
|
68
|
-
def hash_type_to_hash_data(michelson_type, value)
|
69
|
-
type = convert_type(michelson_type)
|
70
|
-
|
71
|
-
converted_value = case michelson_type.to_sym
|
72
|
-
when :nat, :int
|
73
|
-
value.to_s
|
74
|
-
when :timestamp
|
75
|
-
errors.add(:base, "timestamp input must be an instance of Time") unless value.is_a? Time
|
76
|
-
|
77
|
-
value.to_i.to_s
|
78
|
-
else
|
79
|
-
value
|
80
|
-
end
|
81
|
-
|
82
|
-
{ type => converted_value }
|
83
|
-
end
|
84
|
-
|
85
37
|
def _entrypoint
|
86
38
|
@_entrypoint ||= blockchain_client.select_entrypoint(
|
87
39
|
contract_address: contract_address,
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TezosClient
|
4
|
+
module Tools
|
5
|
+
class HashToMicheline < ActiveInteraction::Base
|
6
|
+
class Address < Base
|
7
|
+
def encode
|
8
|
+
raise "#{data} #{data.class} Not a 'String' type" unless data.is_a? ::String
|
9
|
+
{ string: data }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TezosClient
|
4
|
+
module Tools
|
5
|
+
class HashToMicheline < ActiveInteraction::Base
|
6
|
+
class Base
|
7
|
+
def initialize(data:, type:)
|
8
|
+
@data = data
|
9
|
+
@type = type
|
10
|
+
end
|
11
|
+
|
12
|
+
attr_accessor :data, :type
|
13
|
+
|
14
|
+
def value
|
15
|
+
@data = anonymous? ? @data : @data.fetch(var_name)
|
16
|
+
encode
|
17
|
+
end
|
18
|
+
|
19
|
+
protected
|
20
|
+
def encode
|
21
|
+
klass.new(
|
22
|
+
data: data,
|
23
|
+
type: type
|
24
|
+
).encode
|
25
|
+
|
26
|
+
rescue NameError
|
27
|
+
raise
|
28
|
+
raise NotImplementedError, "type '#{type[:prim]}' not implemented"
|
29
|
+
end
|
30
|
+
|
31
|
+
def anonymous?
|
32
|
+
!(type.key?(:annots) && type[:annots].any?)
|
33
|
+
end
|
34
|
+
|
35
|
+
def var_name_annot
|
36
|
+
type[:annots].first
|
37
|
+
end
|
38
|
+
|
39
|
+
def var_name
|
40
|
+
return nil if anonymous?
|
41
|
+
|
42
|
+
"#{var_name_annot[1..-1]}".to_sym
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
def klass
|
47
|
+
"#{self.class.name.deconstantize}::#{type[:prim].to_s.camelize}".constantize
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TezosClient
|
4
|
+
module Tools
|
5
|
+
class HashToMicheline < ActiveInteraction::Base
|
6
|
+
class Bytes < Base
|
7
|
+
def encode
|
8
|
+
raise "#{data} #{data.class} Not a 'String' type" unless data.is_a? ::String
|
9
|
+
{ bytes: data }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TezosClient
|
4
|
+
module Tools
|
5
|
+
class HashToMicheline < ActiveInteraction::Base
|
6
|
+
class Contract < Base
|
7
|
+
def encode
|
8
|
+
raise "#{data} #{data.class} Not a 'String' type" unless data.is_a? ::String
|
9
|
+
{ string: data }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TezosClient
|
4
|
+
module Tools
|
5
|
+
class HashToMicheline < ActiveInteraction::Base
|
6
|
+
class Key < Base
|
7
|
+
def encode
|
8
|
+
raise "#{data} #{data.class} Not a 'String' type" unless data.is_a? ::String
|
9
|
+
{ string: data }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TezosClient
|
4
|
+
module Tools
|
5
|
+
class HashToMicheline < ActiveInteraction::Base
|
6
|
+
class Option < Base
|
7
|
+
def encode
|
8
|
+
return { prim: "None" } if data.nil?
|
9
|
+
|
10
|
+
{
|
11
|
+
prim: "Some",
|
12
|
+
args: [
|
13
|
+
TezosClient::Tools::HashToMicheline::Base.new(
|
14
|
+
data: data,
|
15
|
+
type: type[:args][0]
|
16
|
+
).value
|
17
|
+
]
|
18
|
+
}
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TezosClient
|
4
|
+
module Tools
|
5
|
+
class HashToMicheline < ActiveInteraction::Base
|
6
|
+
class Pair < Base
|
7
|
+
def encode
|
8
|
+
{
|
9
|
+
prim: "Pair",
|
10
|
+
args: [
|
11
|
+
TezosClient::Tools::HashToMicheline::Base.new(
|
12
|
+
data: data_0,
|
13
|
+
type: type[:args][0]
|
14
|
+
).value,
|
15
|
+
TezosClient::Tools::HashToMicheline::Base.new(
|
16
|
+
data: data_1,
|
17
|
+
type: type[:args][1]
|
18
|
+
).value
|
19
|
+
]
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
def data_0
|
24
|
+
if data.is_a? ::Array
|
25
|
+
data[0]
|
26
|
+
else
|
27
|
+
data
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def data_1
|
32
|
+
if data.is_a? ::Array
|
33
|
+
if data.size > 2
|
34
|
+
data.drop(1)
|
35
|
+
else
|
36
|
+
data[1]
|
37
|
+
end
|
38
|
+
else
|
39
|
+
data
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TezosClient
|
4
|
+
module Tools
|
5
|
+
class HashToMicheline < ActiveInteraction::Base
|
6
|
+
class Signature < Base
|
7
|
+
def encode
|
8
|
+
raise "#{data} does not seem to be a signature" unless data.starts_with?("edsig")
|
9
|
+
{ string: data }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TezosClient
|
4
|
+
module Tools
|
5
|
+
class HashToMicheline < ActiveInteraction::Base
|
6
|
+
class String < Base
|
7
|
+
def encode
|
8
|
+
raise "#{data} #{data.class} Not a 'String' type" unless data.is_a? ::String
|
9
|
+
{ string: data }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class TezosClient
|
4
|
+
module Tools
|
5
|
+
class HashToMicheline < ActiveInteraction::Base
|
6
|
+
class Timestamp < Base
|
7
|
+
def encode
|
8
|
+
raise "timestamp input (#{data}) must be an instance of Time" unless data.is_a? Time
|
9
|
+
{ int: data.to_i.to_s }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/tezos_client/version.rb
CHANGED
@@ -11,4 +11,9 @@ sudo add-apt-repository "deb http://fr.archive.ubuntu.com/ubuntu bionic main uni
|
|
11
11
|
sudo apt-get update -qq
|
12
12
|
sudo apt-get install -y -qq \
|
13
13
|
libsecp256k1-dev libsecp256k1-0 libsodium-dev libssl-dev \
|
14
|
-
bubblewrap libev-dev libhidapi-dev
|
14
|
+
bubblewrap libev-dev libhidapi-dev
|
15
|
+
|
16
|
+
wget -qO- https://deb.nodesource.com/setup_14.x | sudo -E bash -
|
17
|
+
sudo apt install -y nodejs
|
18
|
+
node --version
|
19
|
+
npm --version
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tezos_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pierre Michard
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -292,6 +292,18 @@ files:
|
|
292
292
|
- lib/tezos_client/tools/convert_to_hash/timestamp.rb
|
293
293
|
- lib/tezos_client/tools/find_big_maps_in_storage.rb
|
294
294
|
- lib/tezos_client/tools/hash_to_micheline.rb
|
295
|
+
- lib/tezos_client/tools/hash_to_micheline/address.rb
|
296
|
+
- lib/tezos_client/tools/hash_to_micheline/base.rb
|
297
|
+
- lib/tezos_client/tools/hash_to_micheline/bytes.rb
|
298
|
+
- lib/tezos_client/tools/hash_to_micheline/contract.rb
|
299
|
+
- lib/tezos_client/tools/hash_to_micheline/int.rb
|
300
|
+
- lib/tezos_client/tools/hash_to_micheline/key.rb
|
301
|
+
- lib/tezos_client/tools/hash_to_micheline/nat.rb
|
302
|
+
- lib/tezos_client/tools/hash_to_micheline/option.rb
|
303
|
+
- lib/tezos_client/tools/hash_to_micheline/pair.rb
|
304
|
+
- lib/tezos_client/tools/hash_to_micheline/signature.rb
|
305
|
+
- lib/tezos_client/tools/hash_to_micheline/string.rb
|
306
|
+
- lib/tezos_client/tools/hash_to_micheline/timestamp.rb
|
295
307
|
- lib/tezos_client/tools/system_call.rb
|
296
308
|
- lib/tezos_client/tools/temporary_file.rb
|
297
309
|
- lib/tezos_client/version.rb
|
@@ -317,7 +329,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
317
329
|
- !ruby/object:Gem::Version
|
318
330
|
version: '0'
|
319
331
|
requirements: []
|
320
|
-
rubygems_version: 3.0.
|
332
|
+
rubygems_version: 3.0.3
|
321
333
|
signing_key:
|
322
334
|
specification_version: 4
|
323
335
|
summary: Wrapper to the tezos client.
|