etherlite 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: cc3672a5fe74a7af2cd535015ad05b291e5d07c0
4
- data.tar.gz: b67bf5d1345c35d4a4a60da6a8b87d5266607768
3
+ metadata.gz: cc29fa8a2381a001b79627f9b851b9df230fb6d6
4
+ data.tar.gz: 99c02011cd1453f7277bdbb3efe0a4c1aff648b9
5
5
  SHA512:
6
- metadata.gz: b10b9675ff4a41b94e7dba7cfac2797b01008164fab0ac7a1d65ec1b89abb294d57d1ee8c4660dcbdb38470a7f5f1524ad66040fce9366d167aa146b1519db65
7
- data.tar.gz: 0ab16b1be44be94cdbb0a6f6c78bc03154eaeae30c6ce14bcf1f2afd41e68a55c3e1a4cd2873e62ea78443c0fcc80d932dcee91147b7df2eb4b4cefc3e5757f1
6
+ metadata.gz: f385968df3f4005adfb1a0b8605c0995848c71934ee2c4e12e9920d8bc60f1d040a568f15fafdc4dc670d199b6b698a8f8ab5f9772d58918b5fd25d0fbcb67c9
7
+ data.tar.gz: 74527462ecd791fcf1da3a35115cbda0e0c54b42a2405dd8ca4d5ee2ee92b19407d61a88414f62deb7a6b2a9447b036652065c2b2181252eb5b956612c614056
@@ -31,6 +31,10 @@ module Etherlite
31
31
  @first_account ||= accounts.first
32
32
  end
33
33
 
34
+ def account_from_pk(_pk)
35
+ Etherlite::PkAccount.new(connection, _pk)
36
+ end
37
+
34
38
  def_delegators :first_account, :unlock, :lock, :normalized_address, :transfer_to, :call
35
39
  end
36
40
  end
@@ -11,13 +11,14 @@ module Etherlite::Contract
11
11
  end
12
12
 
13
13
  def self.at(_address, client: nil, as: nil)
14
- client ||= ::Etherlite # use default client if no client is provided
14
+ _address = Etherlite::Utils.normalize_address_param _address
15
15
 
16
- new(
17
- client.connection,
18
- Etherlite::Utils.normalize_address_param(_address),
19
- as || client.first_account
20
- )
16
+ if as
17
+ new(as.connection, _address, as)
18
+ else
19
+ client ||= ::Etherlite
20
+ new(client.connection, _address, client.first_account)
21
+ end
21
22
  end
22
23
 
23
24
  attr_reader :connection
@@ -1,3 +1,3 @@
1
1
  module Etherlite
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: etherlite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ignacio Baixas