lib/etherlite/contract/base.rb in etherlite-0.1.2 vs lib/etherlite/contract/base.rb in etherlite-0.1.3

- old
+ new

@@ -9,16 +9,17 @@ def self.events @events ||= [] end def self.at(_address, client: nil, as: nil) - client ||= ::Etherlite # use default client if no client is provided + _address = Etherlite::Utils.normalize_address_param _address - new( - client.connection, - Etherlite::Utils.normalize_address_param(_address), - as || client.first_account - ) + if as + new(as.connection, _address, as) + else + client ||= ::Etherlite + new(client.connection, _address, client.first_account) + end end attr_reader :connection def initialize(_connection, _normalized_address, _default_account)