celo-org / celo-monorepo

Official repository for core projects comprising the Celo platform
https://celo.org
Apache License 2.0
684 stars 360 forks source link

Migrate Mobile App to the new contractkit #475

Closed mcortesi closed 4 years ago

mcortesi commented 4 years ago

Expected Behavior

Use ContractKit

Current Behavior

Uses WalletKit

yerdua commented 4 years ago

blocked by:

671 - contractkit wrapper for Escrow

1042 - contractkit wrapper for GasPriceMinimum

1019 - contractkit wrapper for Attestations

yerdua commented 4 years ago

Missing/Incomplete wrappers

Functions from walletkit without equivalents in contractkit

Functions from walletkit that are Attestations contract or wrapper functions (after #1019):

Renamed functions, walletkit => contractkit

Rough plan for migration after blockers are addressed:

  1. Cache an instance of the contractkit in mobile
  2. Move StaticNodeUtils + GenesisBlockUtils somewhere accessible to the mobile app, and use them in that new location
  3. Replace all contract calls with contractkit contract wrapper interactions
  4. Deal with all other functions with no current equivalents in contractkit
jmrossy commented 4 years ago

Adding some info from the mobile wallet retro meeting:

jmrossy commented 4 years ago

Another small issue to tackle before migrating: Calling contract kit class methods with redux saga effects doesn't work unless the this context is explicitly specified like so:

 const attestationsWrapper: AttestationsWrapper = yield call([
      contractKit.contracts,
      contractKit.contracts.getAttestations,
    ])

Before we fully migrate, we should find a more elegant way to call methods