leapdao / leap-core

library for tx and block signing
GNU Affero General Public License v3.0
15 stars 5 forks source link

getProof: not working with LeapProvider #162

Closed troggy closed 4 years ago

troggy commented 4 years ago

We have getProof helper which is supposed to work with both LeapWeb3 and LeapProvider(aka LeapEthers) passed in via plasma argument.

Newest addition to getProof helper uses plasma for two things:

  1. Get block data via getBlock JSON RPC:
    • Web3: plasma.eth.getBlock (adding .eth. is handled in leap-core)
    • LeapProvider: plasma.provider.getBlock
  2. Get period data via getPeriodByBlockHeight
    • Web3: plasma.getPeriodByBlockHeight
    • LeapProvider: plasma.getPeriodByBlockHeight

The problem is with using LeapProvider for getBlock. As you see, it needs to be called on .provider

troggy commented 4 years ago

not correct.. period data for LeapProvider is read as plasma.provider.getPeriodByBlockHeight so the problem is easy to solve just by passing .provider object as plasma