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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47cb21b47f820960440d6b734508522afd0669f5
4
- data.tar.gz: f95c32cd1cc6fc27aae94a40dabd0638215b9886
3
+ metadata.gz: 3acaf4c843a75d9a4861a8e34951c8e52653747e
4
+ data.tar.gz: dda716a972555bc30cd2115622c987949819ccd7
5
5
  SHA512:
6
- metadata.gz: 431ac7abd03c738136fc014cf36e8646d29f4a1ed07dc10d69701e0d6317660224ec579d75f5ee38675ee51bc17050682b5c507cb7dfa07ef1146d595d4dc13f
7
- data.tar.gz: b9d01fa01a6d3b4c3ab569748052477faf9fcdfe1bebb06fcf2284d6e4e9186d5907c1b520079c95adb28d0cee657774b0f0714d85bd63a660edc01ce16bb713
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 = Uni.send_transaction( from: '0x1111', data: [Greeter, 'Hello World!'] )
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 = Uni.send_transaction( from: '0x1111', data: [Greeter, '¡Hola, mundo!'] )
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
@@ -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 )
@@ -8,7 +8,7 @@ class Universum
8
8
 
9
9
  MAJOR = 0
10
10
  MINOR = 1
11
- PATCH = 0
11
+ PATCH = 1
12
12
  VERSION = [MAJOR,MINOR,PATCH].join('.')
13
13
 
14
14
  def self.version
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 test_run
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: universum
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gerald Bauer