etherlite 0.4.1 → 0.4.2

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
  SHA256:
3
- metadata.gz: e0b83a0a08768dcd1ba56ddc3506b02764f191a3a4c3c5fb2972075090bea6cc
4
- data.tar.gz: d4de2edde2f449cdc3903d5efdee40f22bd76d692517bf48bc92a1138163ce92
3
+ metadata.gz: 7d5972b71c09d1bb9d1a3f732b8c1b5fe0057ad46c0159c1c93e5fbe690ef695
4
+ data.tar.gz: 3b4fc972adac1ecbf23b7188040e8ba729d136ef89f51a4045d9c2339725ff34
5
5
  SHA512:
6
- metadata.gz: a48e9d0e929cc80ccf7446ffc6de6135230e3a1df8fc943d1d426abd8f03c4e66332ca9425163bf9425712547124be26e63962f2d4541eb7b5791e3a5932677d
7
- data.tar.gz: 1f5b1cbc90168849faac07a2d25901795d8e569067f105eeaded88ed5ac970990f5ce6cb2e4bb563dbe313b7519b95a5c09754e16d5b82391e1949365fbfb64a
6
+ metadata.gz: 6b594fc27d066ecd3ee27025f990996d9badc2bc37efc9b770bfad55cf8a96b2779fb61a59d1dbb214de5905bff3863fa7b9975b145f94a9e88521e9055838d0
7
+ data.tar.gz: 416610c6eb6f4466c5aee182147ee8bc456b8aaaf851cf5a1644bde4583df980a3dcaa822c92617e25393bdf145386200366f284c0310fcb13b283032f7a4a94
@@ -39,7 +39,7 @@ module Etherlite::Account
39
39
  end
40
40
 
41
41
  def send_transaction(_options = {})
42
- raise NotSupportedError, 'transactions are not supported by this kind of account'
42
+ raise Etherlite::NotSupportedError, 'transactions are not supported by this kind of account'
43
43
  end
44
44
 
45
45
  def ==(_other)
@@ -50,7 +50,6 @@ module Etherlite::Account
50
50
 
51
51
  def call_constant(_target, _function, _params, _options)
52
52
  params = {
53
- from: json_encoded_address,
54
53
  to: Etherlite::Utils.encode_address_param(_target),
55
54
  data: _function.encode(_params)
56
55
  }
@@ -53,7 +53,11 @@ module Etherlite
53
53
  end
54
54
 
55
55
  def default_account
56
- @default_account ||= load_default_account
56
+ @default_account ||= (accounts.first || anonymous_account)
57
+ end
58
+
59
+ def anonymous_account
60
+ @anonymous_account ||= Etherlite::Account::Anonymous.new(connection)
57
61
  end
58
62
 
59
63
  def account_from_pk(_pk)
@@ -66,13 +70,6 @@ use 'load_account' instead"
66
70
  end
67
71
 
68
72
  def_delegators :default_account, :unlock, :lock, :normalized_address, :transfer_to, :call
69
-
70
- private
71
-
72
- def load_default_account
73
- # TODO: consider configuring a global PK and allow the default account to use it
74
- accounts.first || Etherlite::Account::Anonymous.new(connection)
75
- end
76
73
  end
77
74
  end
78
75
  end
@@ -1,3 +1,3 @@
1
1
  module Etherlite
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etherlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignacio Baixas
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-06-07 00:00:00.000000000 Z
11
+ date: 2021-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: digest-sha3