universum 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/universum/universum.rb +6 -0
- data/lib/universum/version.rb +1 -1
- data/test/test_greeter.rb +24 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3acaf4c843a75d9a4861a8e34951c8e52653747e
|
4
|
+
data.tar.gz: dda716a972555bc30cd2115622c987949819ccd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b0730f852dc73ddf914d6a4faa6ab3c5e67aa5f7991b26b2c7bfbc7d0e0dd713418484b3ffbc6d8256ed836893f19590e8c0633f3edbdc5a10729cf65e0097f
|
7
|
+
data.tar.gz: 645e5279dd0953d7a121a4eec284c1f22a352fcc37e9366e9bba965f2f0aa090837d3617e4531002b7d0314e77732a8fad17008f66972519c98993f3192a064f
|
data/README.md
CHANGED
@@ -87,13 +87,13 @@ require_relative 'greeter'
|
|
87
87
|
|
88
88
|
Account['0x1111'] ## setup a test account
|
89
89
|
|
90
|
-
tx =
|
90
|
+
tx = Tx.send( from: '0x1111', data: [Greeter, 'Hello World!'] )
|
91
91
|
greeter = tx.receipt.contract
|
92
92
|
|
93
93
|
puts greeter.greet
|
94
94
|
#=> Hello World!
|
95
95
|
|
96
|
-
tx =
|
96
|
+
tx = Tx.send( from: '0x1111', data: [Greeter, '¡Hola, mundo!'] )
|
97
97
|
greeter_es = Receipt[ tx ].contract
|
98
98
|
|
99
99
|
puts greeter_es.greet
|
data/lib/universum/universum.rb
CHANGED
@@ -280,6 +280,12 @@ end # class Block
|
|
280
280
|
|
281
281
|
|
282
282
|
class Transaction
|
283
|
+
|
284
|
+
def self.send( **kwargs ) ## convenience helper for Uni.send_transaction
|
285
|
+
Universum.send_transaction( **kwargs )
|
286
|
+
end
|
287
|
+
|
288
|
+
|
283
289
|
attr_reader :from, :to, :value, :data, :nonce
|
284
290
|
|
285
291
|
def initialize( from:, to:, value:, data:, nonce: nil )
|
data/lib/universum/version.rb
CHANGED
data/test/test_greeter.rb
CHANGED
@@ -13,7 +13,7 @@ require 'contracts/greeter' ## use require_relative - why? why not?
|
|
13
13
|
|
14
14
|
class TestGreeter < MiniTest::Test
|
15
15
|
|
16
|
-
def
|
16
|
+
def test_uni
|
17
17
|
account = Account['0x1111']
|
18
18
|
|
19
19
|
tx = Uni.send_transaction( from: '0x1111', data: [Greeter, 'Hello World!'] )
|
@@ -35,4 +35,27 @@ def test_run
|
|
35
35
|
assert '¡Hola, mundo!', greeter_es.greet
|
36
36
|
end
|
37
37
|
|
38
|
+
def test_tx
|
39
|
+
account = Account['0x1111']
|
40
|
+
|
41
|
+
tx = Tx.send( from: '0x1111', data: [Greeter, 'Hello World!'] )
|
42
|
+
pp tx
|
43
|
+
pp tx.receipt
|
44
|
+
|
45
|
+
greeter = tx.receipt.contract
|
46
|
+
|
47
|
+
assert 'Hello World!', greeter.greet
|
48
|
+
assert 'Hello World!', greeter.greet
|
49
|
+
|
50
|
+
tx = Tx.send( from: '0x1111', data: [Greeter, '¡Hola, mundo!'] )
|
51
|
+
|
52
|
+
greeter_es = Receipt[ tx ].contract
|
53
|
+
|
54
|
+
assert '¡Hola, mundo!', greeter_es.greet
|
55
|
+
|
56
|
+
assert 'Hello World!', greeter.greet
|
57
|
+
assert '¡Hola, mundo!', greeter_es.greet
|
58
|
+
end
|
59
|
+
|
60
|
+
|
38
61
|
end # class TestGreeter
|