Method: Eth::Tx#sanitize_address
- Defined in:
- lib/eth/tx.rb
#sanitize_address(addr) ⇒ String
Populates the transaction destination address with a serializable empty value in case it is undefined; also ensures the address is checksummed but not prefixed for consistency.
343 344 345 346 347 348 349 350 |
# File 'lib/eth/tx.rb', line 343 def sanitize_address(addr) addr = "" if addr.nil? if addr.is_a? String and !addr.empty? addr = Address.new(addr).to_s addr = Util.remove_hex_prefix addr end return addr end |