erc20 0.0.7 → 0.0.8

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
  SHA256:
3
- metadata.gz: 47883e48393686ed5d357fb9f5f762e0744a30a8f0999724dd2ddba369ac75ae
4
- data.tar.gz: bad63b9aa6269a79cc2276c10c0f6aec02d8bf94bf18057b89fc0e9f896833be
3
+ metadata.gz: 2a6045ef455a8f096b144b8a680abd27df0b56c3d66b55893ad7f0f3dc4e4203
4
+ data.tar.gz: e5276a87ad3ac48ec1df0928e28bc18295e3033a280fe1172d1d9199b582c54f
5
5
  SHA512:
6
- metadata.gz: bf78c2548b09b33c9e67ba7476d9e14576f9be07ca1cbb1620067899451c96c587a87849d7c86c88ec449254362db9d921a4d0fde9534954b8ad9c48405f4b51
7
- data.tar.gz: 224500ace20e3abaa25bbdc4a6be32fe7fca7b57b7d7b2bf4a4b01a8dac50a3fb45bf2a70c13f2f737b502a5ea80c4f452eeda5d0737ed6c5087d1458b590f20
6
+ metadata.gz: e964c619368827683031db7eae717c662cc292eb60b0cded4868968e19bdebb1ab091c3ad1edc65e78aa4d0ba2b451587b9f77cf38ac381765776a7b078182f6
7
+ data.tar.gz: 83793a79b62811b4f34589a5d60db5cec07f707e04673ef02adcf29e81eaf7d91f3ad7198d2c4bbfc2645032cf8a6c2ac508ec477a3a60edf5874401864c2e20
data/lib/erc20/wallet.rb CHANGED
@@ -118,7 +118,7 @@ class ERC20::Wallet
118
118
  jsonrpc.eth_sendRawTransaction(hex)
119
119
  end
120
120
  @log.debug("Sent #{amount} from #{from} to #{address}: #{tnx}")
121
- tnx
121
+ tnx.downcase
122
122
  end
123
123
 
124
124
  # Wait for incoming transactions and let the block know when they
@@ -179,7 +179,7 @@ class ERC20::Wallet
179
179
  amount: event['data'].to_i(16),
180
180
  from: "0x#{event['topics'][1][26..].downcase}",
181
181
  to: "0x#{event['topics'][2][26..].downcase}",
182
- txn: event['transactionHash']
182
+ txn: event['transactionHash'].downcase
183
183
  }
184
184
  log.debug("Payment of #{event[:amount]} tokens arrived from #{event[:from]} to #{event[:to]}")
185
185
  end
data/lib/erc20.rb CHANGED
@@ -27,5 +27,5 @@
27
27
  # License:: MIT
28
28
  module ERC20
29
29
  # Current version of the gem (changed by .rultor.yml on every release)
30
- VERSION = '0.0.7'
30
+ VERSION = '0.0.8'
31
31
  end
@@ -63,12 +63,13 @@ class TestWallet < Minitest::Test
63
63
  end
64
64
 
65
65
  def test_fails_with_invalid_infura_key
66
+ skip('Apparently, even with invalid key, Infura returns balance')
66
67
  w = ERC20::Wallet.new(
67
68
  host: 'mainnet.infura.io',
68
69
  http_path: '/v3/invalid-key-here',
69
70
  log: loog
70
71
  )
71
- assert_raises(StandardError) { w.balance(STABLE) }
72
+ assert_raises(StandardError) { p w.balance(STABLE) }
72
73
  end
73
74
 
74
75
  def test_checks_balance_on_testnet
@@ -113,6 +114,7 @@ class TestWallet < Minitest::Test
113
114
  assert_operator(wallet.balance(from), :>, sum * 2)
114
115
  txn = wallet.pay(JEFF, to, sum)
115
116
  assert_equal(66, txn.length)
117
+ assert_match(/^0x[a-f0-9]{64}$/, txn)
116
118
  assert_equal(before + sum, wallet.balance(to))
117
119
  end
118
120
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: erc20
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yegor Bugayenko