universa 3.9.14.7 → 3.9.15.pre.p1

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
2
  SHA256:
3
- metadata.gz: fa4b8c59d86810948f6b69236fcb0ec642c88c7281a6994935ffed57d7e9c6e6
4
- data.tar.gz: b547a7d4fd353a29c01aafa6ac8d4c7e4a74f284cffb570294878f85fdfa3fdb
3
+ metadata.gz: 3c832c5c6c09d78dd63261bf9a95ea1e559aea0d415b14d23a659f6b006dc75a
4
+ data.tar.gz: 74f5ccc57534fcb8f9ec0102148b525e6c95f08e40a629f206571ddf9774b14a
5
5
  SHA512:
6
- metadata.gz: 9f5f308c6b089b97635dd2eeb3f9136efccbd40077d19084e49a0b7ae71348e4b767cdcd3e915096df9a816d88a1d8c068958205d9a947fc20d7d3c7761d67b1
7
- data.tar.gz: 4fb19404da64e8e87d3215207c2c38c29a3c66d14479ecf89ea958170ff6fab59ce14ab7685368c489d0635de388ba0e71979b596a8fa2fbbe81c23641c33228
6
+ metadata.gz: afd6b03188397c596f9632fef6209c2a9de4c8873425585a3fcd31009ffa952669934a7e0887e5be599b0c001200e710c27395c766b11636b6559b0770aa46e1
7
+ data.tar.gz: 4dcf3f62e9cc34912131444c0274f71a9457bae080eeddf99e102d2c23aa4efc1a84c291d06cfbffea4a75ff79bfcd52d4d0c0b9dfa4200244bfe0cf6e1fbfaa
data/bin/umi/bin/umi CHANGED
@@ -344,7 +344,7 @@ declare -r lib_dir="$(realpath "${app_home}/../lib")"
344
344
  declare -a app_mainclass=(com.icodici.farcallscala.Main)
345
345
 
346
346
  declare -r script_conf_file="${app_home}/../conf/application.ini"
347
- declare -r app_classpath="$lib_dir/com.icodici.umi-0.8.36.jar:$lib_dir/org.scala-lang.scala-library-2.12.7.jar:$lib_dir/com.icodici.universa_core-3.9.14.jar:$lib_dir/org.yaml.snakeyaml-1.18.jar:$lib_dir/com.icodici.nanohttpd-2.1.0.jar:$lib_dir/com.icodici.common_tools-3.9.14.jar:$lib_dir/com.eclipsesource.minimal-json.minimal-json-0.9.4.jar:$lib_dir/net.java.dev.jna.jna-4.5.1.jar:$lib_dir/org.checkerframework.checker-qual-2.3.2.jar:$lib_dir/com.icodici.crypto-3.9.14.jar:$lib_dir/com.madgag.spongycastle.core-1.58.0.0.jar:$lib_dir/com.squareup.jnagmp.jnagmp-2.0.0.jar:$lib_dir/com.typesafe.play.play-json_2.12-2.6.10.jar:$lib_dir/com.typesafe.play.play-functional_2.12-2.6.10.jar:$lib_dir/org.scala-lang.scala-reflect-2.12.7.jar:$lib_dir/org.typelevel.macro-compat_2.12-1.1.1.jar:$lib_dir/joda-time.joda-time-2.9.9.jar:$lib_dir/com.fasterxml.jackson.core.jackson-core-2.8.11.jar:$lib_dir/com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar:$lib_dir/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar:$lib_dir/com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar:$lib_dir/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar:$lib_dir/org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar:$lib_dir/net.java.dev.jna.jna-platform-4.5.0.jar:$lib_dir/net.sf.jopt-simple.jopt-simple-4.9.jar"
347
+ declare -r app_classpath="$lib_dir/com.icodici.umi-0.8.33.jar:$lib_dir/org.scala-lang.scala-library-2.12.7.jar:$lib_dir/com.icodici.universa_core-3.9.14.jar:$lib_dir/org.yaml.snakeyaml-1.18.jar:$lib_dir/com.icodici.nanohttpd-2.1.0.jar:$lib_dir/com.icodici.common_tools-3.9.14.jar:$lib_dir/com.eclipsesource.minimal-json.minimal-json-0.9.4.jar:$lib_dir/net.java.dev.jna.jna-4.5.1.jar:$lib_dir/org.checkerframework.checker-qual-2.3.2.jar:$lib_dir/com.icodici.crypto-3.9.14.jar:$lib_dir/com.madgag.spongycastle.core-1.58.0.0.jar:$lib_dir/com.squareup.jnagmp.jnagmp-2.0.0.jar:$lib_dir/com.typesafe.play.play-json_2.12-2.6.10.jar:$lib_dir/com.typesafe.play.play-functional_2.12-2.6.10.jar:$lib_dir/org.scala-lang.scala-reflect-2.12.7.jar:$lib_dir/org.typelevel.macro-compat_2.12-1.1.1.jar:$lib_dir/joda-time.joda-time-2.9.9.jar:$lib_dir/com.fasterxml.jackson.core.jackson-core-2.8.11.jar:$lib_dir/com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar:$lib_dir/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar:$lib_dir/com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar:$lib_dir/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar:$lib_dir/org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar:$lib_dir/net.java.dev.jna.jna-platform-4.5.0.jar:$lib_dir/net.sf.jopt-simple.jopt-simple-4.9.jar"
348
348
 
349
349
  # java_cmd is overrode in process_args when -java-home is used
350
350
  declare java_cmd=$(get_java_cmd)
data/bin/umi/bin/umi.bat CHANGED
@@ -80,7 +80,7 @@ rem "-J" is stripped, "-D" is left as is, and everything is appended to JAVA_OPT
80
80
  set _JAVA_PARAMS=
81
81
  set _APP_ARGS=
82
82
 
83
- set "APP_CLASSPATH=%APP_LIB_DIR%\com.icodici.umi-0.8.36.jar;%APP_LIB_DIR%\org.scala-lang.scala-library-2.12.7.jar;%APP_LIB_DIR%\com.icodici.universa_core-3.9.14.jar;%APP_LIB_DIR%\org.yaml.snakeyaml-1.18.jar;%APP_LIB_DIR%\com.icodici.nanohttpd-2.1.0.jar;%APP_LIB_DIR%\com.icodici.common_tools-3.9.14.jar;%APP_LIB_DIR%\com.eclipsesource.minimal-json.minimal-json-0.9.4.jar;%APP_LIB_DIR%\net.java.dev.jna.jna-4.5.1.jar;%APP_LIB_DIR%\org.checkerframework.checker-qual-2.3.2.jar;%APP_LIB_DIR%\com.icodici.crypto-3.9.14.jar;%APP_LIB_DIR%\com.madgag.spongycastle.core-1.58.0.0.jar;%APP_LIB_DIR%\com.squareup.jnagmp.jnagmp-2.0.0.jar;%APP_LIB_DIR%\com.typesafe.play.play-json_2.12-2.6.10.jar;%APP_LIB_DIR%\com.typesafe.play.play-functional_2.12-2.6.10.jar;%APP_LIB_DIR%\org.scala-lang.scala-reflect-2.12.7.jar;%APP_LIB_DIR%\org.typelevel.macro-compat_2.12-1.1.1.jar;%APP_LIB_DIR%\joda-time.joda-time-2.9.9.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-core-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar;%APP_LIB_DIR%\com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar;%APP_LIB_DIR%\org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar;%APP_LIB_DIR%\net.java.dev.jna.jna-platform-4.5.0.jar;%APP_LIB_DIR%\net.sf.jopt-simple.jopt-simple-4.9.jar"
83
+ set "APP_CLASSPATH=%APP_LIB_DIR%\com.icodici.umi-0.8.33.jar;%APP_LIB_DIR%\org.scala-lang.scala-library-2.12.7.jar;%APP_LIB_DIR%\com.icodici.universa_core-3.9.14.jar;%APP_LIB_DIR%\org.yaml.snakeyaml-1.18.jar;%APP_LIB_DIR%\com.icodici.nanohttpd-2.1.0.jar;%APP_LIB_DIR%\com.icodici.common_tools-3.9.14.jar;%APP_LIB_DIR%\com.eclipsesource.minimal-json.minimal-json-0.9.4.jar;%APP_LIB_DIR%\net.java.dev.jna.jna-4.5.1.jar;%APP_LIB_DIR%\org.checkerframework.checker-qual-2.3.2.jar;%APP_LIB_DIR%\com.icodici.crypto-3.9.14.jar;%APP_LIB_DIR%\com.madgag.spongycastle.core-1.58.0.0.jar;%APP_LIB_DIR%\com.squareup.jnagmp.jnagmp-2.0.0.jar;%APP_LIB_DIR%\com.typesafe.play.play-json_2.12-2.6.10.jar;%APP_LIB_DIR%\com.typesafe.play.play-functional_2.12-2.6.10.jar;%APP_LIB_DIR%\org.scala-lang.scala-reflect-2.12.7.jar;%APP_LIB_DIR%\org.typelevel.macro-compat_2.12-1.1.1.jar;%APP_LIB_DIR%\joda-time.joda-time-2.9.9.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-core-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar;%APP_LIB_DIR%\com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar;%APP_LIB_DIR%\org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar;%APP_LIB_DIR%\net.java.dev.jna.jna-platform-4.5.0.jar;%APP_LIB_DIR%\net.sf.jopt-simple.jopt-simple-4.9.jar"
84
84
  set "APP_MAIN_CLASS=com.icodici.farcallscala.Main"
85
85
  set "SCRIPT_CONF_FILE=%APP_HOME%\conf\application.ini"
86
86
 
@@ -20,8 +20,8 @@ module Universa
20
20
  end
21
21
 
22
22
  # Create hew Binder from any hash. Keys will be converted to strings.
23
- def self.of *args
24
- invoke_static "of", *args
23
+ def self.of hash
24
+ invoke_static "of", hash.transform_keys(&:to_s)
25
25
  end
26
26
 
27
27
  # Retrieve binder keys
@@ -67,37 +67,14 @@ module Universa
67
67
  (0...size).to_a.sample(number).map {|n| self[n]}
68
68
  end
69
69
 
70
- # Perform fast consensus state check with a given trust level, determining whether the item is approved or not.
71
- # Blocks for 1 minute or until the network solution will be collected for a given trust level.
70
+ # Perform fast consensus state check with a given trust level, as the fraction of the whole network size.
71
+ # It checks the network nodes randomly until get enough positive or negative states. The lover the required
72
+ # trust level is, the faster the answer will be found.
72
73
  #
73
- # @param [Contract | HashId | String | Binary] obj contract to check
74
+ # @param [Contract | HashId] obj contract to check
74
75
  # @param [Object] trust level, should be between 0.1 (10% of network) and 0.9 (90% of the network)
75
- # @return true if the contract state is approved by the network with a given trust level, false otherwise.
76
- def is_approved? obj, trust: 0.3
77
- hash_id = case obj
78
- when HashId
79
- obj
80
- when Contract
81
- obj.hash_id
82
- when String
83
- if obj.encoding == Encoding::ASCII_8BIT
84
- HashId.from_digest(obj)
85
- else
86
- HashId.from_string(obj)
87
- end
88
- else
89
- raise ArgumentError "wrong type of object to check approval"
90
- end
91
- @client.isApprovedByNetwork(hash_id, trust.to_f, 60000)
92
- end
93
- # Perform fast consensus state check with a given trust level, as the fraction of the whole network size.
94
- # It checks the network nodes randomly until get enough positive or negative states. The lover the required
95
- # trust level is, the faster the answer will be found.
96
- #
97
- # @param [Contract | HashId] obj contract to check
98
- # @param [Object] trust level, should be between 0.1 (10% of network) and 0.9 (90% of the network)
99
- # @return [ContractState] of some final node check It does not calculates average time (yet)
100
- def get_state obj, trust: 0.3
76
+ # @return [ContractState] of some final node check It does not calculates average time (yet)
77
+ def get_state obj, trust: 0.3
101
78
  raise ArgumentError, "trusst must be in 0.1..0.9 range" if trust < 0.1 || trust > 0.9
102
79
  result = Concurrent::IVar.new
103
80
  negative_votes = Concurrent::AtomicFixnum.new((size * 0.1).round + 1)
@@ -12,7 +12,6 @@ module Universa
12
12
  remote_class "com.icodici.universa.contract.permissions.RevokePermission"
13
13
  end
14
14
 
15
- # Adapter for plitjoin permission
16
15
  class SplitJoinPermission < RemoteAdapter
17
16
  remote_class "com.icodici.universa.contract.permissions.SplitJoinPermission"
18
17
  end
@@ -20,53 +19,9 @@ module Universa
20
19
  # Adapter for Universa Role
21
20
  class Role < RemoteAdapter
22
21
  remote_class "com.icodici.universa.contract.roles.Role"
23
-
24
- class RequireMode
25
- ALL_OF = "ALL_OF"
26
- ANY_OF = "ANY_OF"
27
- end
28
- end
29
-
30
- # Adaoter for link role
31
- class RoleLink < RemoteAdapter
32
- remote_class "com.icodici.universa.contract.roles.RoleLink"
33
- end
34
-
35
- # adapter for a simple (key owner) role
36
- class SimpleRole < RemoteAdapter
37
- remote_class "com.icodici.universa.contract.roles.SimpleRole"
38
- end
39
-
40
- # adapter for a role that is a list of roles
41
- class ListRole < RemoteAdapter
42
- remote_class "com.icodici.universa.contract.roles.ListRole"
43
- end
44
-
45
- # Adapter for permission to modify data
46
- class ModifyDataPermission < RemoteAdapter
47
- remote_class "com.icodici.universa.contract.permissions.ModifyDataPermission"
48
22
  end
49
23
 
50
24
 
51
- # Wrapper for Java API Reference class
52
-
53
- class Reference < RemoteAdapter
54
- remote_class "com.icodici.universa.contract.Reference"
55
-
56
- remote_field :name, :type, :transactional_id, :contract_id, :required, :origin, :signed_by, :fields, :roles,
57
- :matchingItems
58
-
59
- alias matching_items matchingItems
60
-
61
- ALL_OF = 'all_of'
62
- ANY_OF = 'any_of'
63
- SIMPLE_CONDITION = 'simple_condition'
64
-
65
- TYPE_TRANSACTIONAL = 1
66
- TYPE_EXISTING_DEFINITION = 2
67
- TYPE_EXISTING_STATE = 3
68
- end
69
-
70
25
  # adapter for Universa TransactionPack
71
26
  class TransactionPack < RemoteAdapter
72
27
  remote_class "com.icodici.universa.contract.TransactionPack"
@@ -102,13 +57,6 @@ module Universa
102
57
  invoke_static 'with_digest', string_id
103
58
  end
104
59
 
105
- # Create a random HashId
106
- # @return [HashId] random HashId
107
- def self.create_random
108
- invoke_static 'create_random'
109
- end
110
-
111
-
112
60
  # Get binary representation. It is shorter than string representation but contain non-printable characters and
113
61
  # can cause problems if treated like a string. Use {#to_s} to get string representation instead.
114
62
  #
@@ -11,7 +11,7 @@ module Universa::FSStore
11
11
  # @!method amount
12
12
  # @return [BigDecimal] +contract.state.data.amount+ or nil. See {Contract#amount} for more.
13
13
  #
14
- class Entry < Universa::StoredContractBase
14
+ class Entry < Universa::StoredContract
15
15
 
16
16
  extend Forwardable
17
17
 
@@ -143,19 +143,6 @@ module Universa
143
143
  def self.invoke_static(method_name, *args)
144
144
  Service.umi.invoke_static @remote_class_name, method_name, *args
145
145
  end
146
-
147
- def self.remote_field *names
148
- names.each {|name|
149
- class_eval <<-End
150
- def #{name}
151
- Service.umi.get_field(self,"#{name}")
152
- end
153
- def #{name}=(value)
154
- Service.umi.set_field(self,"#{name}", value)
155
- end
156
- End
157
- }
158
- end
159
146
  end
160
147
 
161
148
  end
@@ -1,7 +1,5 @@
1
1
  module Universa
2
2
 
3
- # under construction, pls on not use yet
4
- #
5
3
  # this is a base class for a contract stored in some contract chain. The implementation
6
4
  # must inherit and implement its {#load} and {#save} methods at least. To do it,
7
5
  # inherit and implement {ChainStore} to work with it.
@@ -11,7 +9,7 @@ module Universa
11
9
  # - contract could be assigned only once, no matter how, so its fields could be cached.
12
10
  # - origin, hash_id and parent are cached. So other contract parameters should be.
13
11
  #
14
- class StoredContractBase
12
+ class StoredContract
15
13
 
16
14
  # {ChainStore} instance to which it is connected
17
15
  attr :chain_store
data/lib/universa/umi.rb CHANGED
@@ -122,19 +122,6 @@ module Universa
122
122
  encode_result call("invoke", class_name, method.to_s.camelize_lower, *prepare_args(args))
123
123
  end
124
124
 
125
- def get_field(remote_object, name)
126
- encode_result call("get_field", remote_object._remote_id, name)
127
- end
128
-
129
- def set_field(remote_object, name, value)
130
- call("set_field", remote_object._remote_id, name, prepare(value))
131
- value
132
- end
133
-
134
- def invoke_static(class_name, method, *args)
135
- encode_result call("invoke", class_name, method.to_s.camelize_lower, *prepare_args(args))
136
- end
137
-
138
125
  # Close child process. No remote calls should occur after it.
139
126
  def close
140
127
  @queue.push :poison_pill
@@ -260,9 +247,7 @@ module Universa
260
247
 
261
248
  # convert single argument to UMI value to pass
262
249
  def prepare(x)
263
- # p [:pre, x]
264
250
  if x.respond_to?(:_as_umi_arg)
265
- # p ["uniarg"]
266
251
  x._as_umi_arg(self)
267
252
  else
268
253
  case x
@@ -281,16 +266,13 @@ module Universa
281
266
  when String
282
267
  x.encoding == Encoding::BINARY ? {__type: 'binary', base64: Base64.encode64(x)} : x
283
268
  when Ref
284
- # p [:ref]
285
269
  x._as_umi_arg(self)
286
270
  when RemoteAdapter
287
- # p [:ra, x.__getobj__._as_umi_arg(self)]
288
271
  # this need special treatment with direct call:
289
272
  x.__getobj__._as_umi_arg(self)
290
273
  when Hash
291
- # p [:hash]
292
274
  result = {}
293
- x.each {|k, v| result[k] = prepare(v)}
275
+ x.each { |k,v| result[k] = prepare(v)}
294
276
  result
295
277
  else
296
278
  x
@@ -301,7 +283,7 @@ module Universa
301
283
  # Convert remote call result from UMI structures to ruby types
302
284
  def encode_result value
303
285
  case value
304
- when Hash
286
+ when Hashie::Mash
305
287
  type = value.__type
306
288
  case type
307
289
  when 'RemoteObject';
@@ -311,8 +293,7 @@ module Universa
311
293
  when 'unixtime';
312
294
  Time.at(value.seconds)
313
295
  else
314
- # Deep hash conversion
315
- value.transform_values! {|v| encode_result(v)}
296
+ value
316
297
  end
317
298
  when Hashie::Array
318
299
  value.map {|x| encode_result x}
@@ -1,4 +1,4 @@
1
1
  module Universa
2
2
  # Current gem version
3
- VERSION = "3.9.14.7"
3
+ VERSION = "3.9.15-p1"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: universa
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.14.7
4
+ version: 3.9.15.pre.p1
5
5
  platform: ruby
6
6
  authors:
7
7
  - sergeych
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-15 00:00:00.000000000 Z
11
+ date: 2019-05-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: farcall
@@ -139,7 +139,7 @@ files:
139
139
  - bin/umi/lib/com.icodici.common_tools-3.9.14.jar
140
140
  - bin/umi/lib/com.icodici.crypto-3.9.14.jar
141
141
  - bin/umi/lib/com.icodici.nanohttpd-2.1.0.jar
142
- - bin/umi/lib/com.icodici.umi-0.8.36.jar
142
+ - bin/umi/lib/com.icodici.umi-0.8.33.jar
143
143
  - bin/umi/lib/com.icodici.universa_core-3.9.14.jar
144
144
  - bin/umi/lib/com.madgag.spongycastle.core-1.58.0.0.jar
145
145
  - bin/umi/lib/com.squareup.jnagmp.jnagmp-2.0.0.jar
@@ -192,9 +192,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
192
192
  version: '0'
193
193
  required_rubygems_version: !ruby/object:Gem::Requirement
194
194
  requirements:
195
- - - ">="
195
+ - - ">"
196
196
  - !ruby/object:Gem::Version
197
- version: '0'
197
+ version: 1.3.1
198
198
  requirements: []
199
199
  rubygems_version: 3.0.3
200
200
  signing_key:
Binary file