universa 3.9.15.2 → 3.9.17.1
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 +4 -4
- data/bin/umi/bin/umi +1 -1
- data/bin/umi/bin/umi.bat +1 -1
- data/bin/umi/lib/{com.icodici.common_tools-3.9.14.jar → com.icodici.common_tools-3.9.17.jar} +0 -0
- data/bin/umi/lib/{com.icodici.crypto-3.9.14.jar → com.icodici.crypto-3.9.17.jar} +0 -0
- data/bin/umi/lib/{com.icodici.umi-0.8.40.jar → com.icodici.umi-0.8.41.jar} +0 -0
- data/bin/umi/lib/{com.icodici.universa_core-3.9.14.jar → com.icodici.universa_core-3.9.17.jar} +0 -0
- data/lib/universa.rb +1 -0
- data/lib/universa/service.rb +14 -2
- data/lib/universa/umi.rb +0 -2
- data/lib/universa/universa_helpers.rb +65 -0
- data/lib/universa/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a0d2c757ab7feb8cd652f1308484ec69996609c164bf2c76ee8160187399ef31
|
|
4
|
+
data.tar.gz: 3e0a4667f1aa418482ad7e2cc0ed0a44e73d2e0c6fba6977baf4e9357f8ccc43
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a317317829618d69b06650cf879c2356bc9e20d3c4ff2cf8658019b74b90c50a3361f98082f4571be1ddc4d68b28727f23d69531eba64aea485ad6e183485037
|
|
7
|
+
data.tar.gz: ceee44c5c748a08e87346f2be05b909097c4560536d04ea9d6fc37393cde0e2e2a87041318dd24d19081ec401534eb03ba99d3dd45647e42b84297306f1a83fc
|
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.
|
|
347
|
+
declare -r app_classpath="$lib_dir/com.icodici.umi-0.8.41.jar:$lib_dir/org.scala-lang.scala-library-2.12.7.jar:$lib_dir/com.icodici.universa_core-3.9.17.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.17.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.17.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.
|
|
83
|
+
set "APP_CLASSPATH=%APP_LIB_DIR%\com.icodici.umi-0.8.41.jar;%APP_LIB_DIR%\org.scala-lang.scala-library-2.12.7.jar;%APP_LIB_DIR%\com.icodici.universa_core-3.9.17.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.17.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.17.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
|
|
data/bin/umi/lib/{com.icodici.common_tools-3.9.14.jar → com.icodici.common_tools-3.9.17.jar}
RENAMED
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/bin/umi/lib/{com.icodici.universa_core-3.9.14.jar → com.icodici.universa_core-3.9.17.jar}
RENAMED
|
Binary file
|
data/lib/universa.rb
CHANGED
data/lib/universa/service.rb
CHANGED
|
@@ -8,14 +8,26 @@ module Universa
|
|
|
8
8
|
# As UMI server is multithreaded by nature, is will not block ruby threads waiting for remote
|
|
9
9
|
# invocation.
|
|
10
10
|
class Service
|
|
11
|
+
|
|
12
|
+
@@log_umi = false
|
|
13
|
+
|
|
14
|
+
# set log mode for UMI commands. Works only when called before any Service usage, e.g. before the
|
|
15
|
+
# UMI client has been constructed.
|
|
16
|
+
def self.log_umi
|
|
17
|
+
@@log_umi = true
|
|
18
|
+
end
|
|
19
|
+
|
|
11
20
|
include Singleton
|
|
12
21
|
|
|
13
22
|
# Setup service initial parameters
|
|
14
23
|
def initialize
|
|
15
24
|
@config = SmartHash.new path: nil
|
|
25
|
+
@@log_umi && @config['log'] = 'umi.log'
|
|
16
26
|
@known_proxies = {}
|
|
17
|
-
[Contract, PrivateKey, PublicKey, KeyAddress, HashId, Binder,
|
|
18
|
-
|
|
27
|
+
[Contract, PrivateKey, PublicKey, KeyAddress, HashId, Binder,
|
|
28
|
+
Role, SimpleRole, RoleLink, ListRole,
|
|
29
|
+
ChangeOwnerPermission, RevokePermission, ModifyDataPermission, SplitJoinPermission,
|
|
30
|
+
UmiClient, Duration].each {|klass| register_proxy klass}
|
|
19
31
|
end
|
|
20
32
|
|
|
21
33
|
# Implementation of {Service.configure}
|
data/lib/universa/umi.rb
CHANGED
|
@@ -340,8 +340,6 @@ module Universa
|
|
|
340
340
|
# perform UMI remote call
|
|
341
341
|
def call(command, *args)
|
|
342
342
|
log ">> #{command}(#{args})"
|
|
343
|
-
# result = @endpoint.sync_call(command, *args, **EMPTY_KWARGS)
|
|
344
|
-
|
|
345
343
|
mx = Mutex.new
|
|
346
344
|
cv = ConditionVariable.new()
|
|
347
345
|
error, result = nil, nil
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
module Universa
|
|
2
|
+
|
|
3
|
+
module Checks
|
|
4
|
+
def ensure_type obj, type, name
|
|
5
|
+
obj.is_a?(type) or raise ArgumentError, "#{name} must be a #{type}, but is a #{obj.type}"
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
def ensure_nullable_type obj, type, name
|
|
9
|
+
obj == nil || ensure_type(obj, type, name)
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
include Checks
|
|
14
|
+
|
|
15
|
+
# Adapter for java.time.Duration class used in some Universa calls
|
|
16
|
+
class Duration < RemoteAdapter
|
|
17
|
+
remote_class "java.time.Duration"
|
|
18
|
+
|
|
19
|
+
static_method :of_seconds
|
|
20
|
+
static_method :of_minutes
|
|
21
|
+
static_method :of_hours
|
|
22
|
+
static_method :of_days
|
|
23
|
+
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Secure loan helper class builds and runs secure loan smart contracts
|
|
27
|
+
class SecureLoanHelper < RemoteAdapter
|
|
28
|
+
remote_class "com.icodici.universa.contract.helpers.SecureLoanHelper"
|
|
29
|
+
|
|
30
|
+
static_method :initSecureLoan
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# initSecureLoan with named arguments and type checks.
|
|
34
|
+
#
|
|
35
|
+
# @param [KeyAddress] lender_address
|
|
36
|
+
# @param [KeyAddress] borrower_address
|
|
37
|
+
# @param [Contract] loan_contract
|
|
38
|
+
# @param [Duration] duration
|
|
39
|
+
# @param [Map] data
|
|
40
|
+
# @param [Contract] collateral
|
|
41
|
+
# @param [Boolean] mintable
|
|
42
|
+
# @param [BigDecimal] repayment_amount
|
|
43
|
+
# @param [String] repayment_currency
|
|
44
|
+
# @param [KeyAddress] repayment_origin
|
|
45
|
+
#
|
|
46
|
+
# @return [Array()Contrtact)] two elements contracts array: loan contract, modified
|
|
47
|
+
def self.create(lender_address:, borrower_address:, loan_contract:, duration:, data: {}, collateral:,
|
|
48
|
+
mintable:, repayment_amount:, repayment_currency: nil, repayment_origin: nil, repayment_issuer: nil)
|
|
49
|
+
|
|
50
|
+
ensure_type lender_address, KeyAddress, "lender_address"
|
|
51
|
+
ensure_type borrower_address, KeyAddress, "lender_address"
|
|
52
|
+
ensure_type loan_contract, Contract, "loan_contract"
|
|
53
|
+
ensure_type duration, Duration, "duration"
|
|
54
|
+
ensure_type collateral, Contract, "collateral"
|
|
55
|
+
ensure_type repayment_amount, BigDecimal, "repayment_amount"
|
|
56
|
+
ensure_nullable_type repayment_currency, String, "repayment_currency"
|
|
57
|
+
ensure_nullable_type repayment_origin, HashId, "repayment_currency"
|
|
58
|
+
ensure_nullable_type repayment_issuer, KeyAddress, "repayment_issuer"
|
|
59
|
+
|
|
60
|
+
initSecureLoan(Binder.of(data), lender_address, borrower_address, loan_contract, duration, collateral, repayment_amount,
|
|
61
|
+
mintable, repayment_origin, repayment_issuer, repayment_currency)
|
|
62
|
+
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
data/lib/universa/version.rb
CHANGED
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.
|
|
4
|
+
version: 3.9.17.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- sergeych
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-07-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: farcall
|
|
@@ -136,11 +136,11 @@ files:
|
|
|
136
136
|
- bin/umi/lib/com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar
|
|
137
137
|
- bin/umi/lib/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar
|
|
138
138
|
- bin/umi/lib/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar
|
|
139
|
-
- bin/umi/lib/com.icodici.common_tools-3.9.
|
|
140
|
-
- bin/umi/lib/com.icodici.crypto-3.9.
|
|
139
|
+
- bin/umi/lib/com.icodici.common_tools-3.9.17.jar
|
|
140
|
+
- bin/umi/lib/com.icodici.crypto-3.9.17.jar
|
|
141
141
|
- bin/umi/lib/com.icodici.nanohttpd-2.1.0.jar
|
|
142
|
-
- bin/umi/lib/com.icodici.umi-0.8.
|
|
143
|
-
- bin/umi/lib/com.icodici.universa_core-3.9.
|
|
142
|
+
- bin/umi/lib/com.icodici.umi-0.8.41.jar
|
|
143
|
+
- bin/umi/lib/com.icodici.universa_core-3.9.17.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
|
|
146
146
|
- bin/umi/lib/com.typesafe.play.play-functional_2.12-2.6.10.jar
|
|
@@ -173,6 +173,7 @@ files:
|
|
|
173
173
|
- lib/universa/u_settings.rb
|
|
174
174
|
- lib/universa/ubox.rb
|
|
175
175
|
- lib/universa/umi.rb
|
|
176
|
+
- lib/universa/universa_helpers.rb
|
|
176
177
|
- lib/universa/version.rb
|
|
177
178
|
- lib/universa/weak_reference.rb
|
|
178
179
|
- sample_ping.rb
|