Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Declutter @truffle/interface-adapter #2610

Merged
merged 3 commits into from
Nov 18, 2019
Merged

Conversation

gnidan
Copy link
Contributor

@gnidan gnidan commented Nov 17, 2019

  • Convert InterfaceAdapter from class to interface, implemented by Web3InterfaceAdapter
  • Export createInterfaceAdapter function in place of class constructor
  • Organize modules in to lib/shim/ and lib/adapter/

- Move shim stuff into lib/shim/
  - Move lib/web3-shim to lib/shim/index
  - Move overloads lib/*-overloads to lib/shim/overloads/*
- Move adapter stuff into lib/adapter/
  - Move lib/interface-adapter.ts to lib/adapter/index.ts
  - Move lib/interface-adapter/types/index.d to lib/adapter/types
  - Rename lib/interface-adapter to lib/adapter (better autocomplete)
  - Move lib/web3-interface-adapter to lib/adapter/web3
- Replace `new InterfaceAdapter` with `createInterfaceAdapter`
- Remove setProvider and setNetworkType from interface
- Recreate interface adapter in @truffle/contract instead of mutating
- Move InterfaceAdapter to ./types
- (also) Export all types in package root
- Remove Web3InterfaceAdapter's setProvider method (not part of iface)
- Define Web3InterfaceAdapterOptions explicitly, not related to shim
- Update Web3InterfaceAdapter class to implement InterfaceAdapter
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.02%) to 73.405% when pulling eb2ecc3 on interface-adapter-interface into be5289a on develop.

@gnidan gnidan marked this pull request as ready for review November 17, 2019 04:57
Copy link
Contributor

@CruzMolina CruzMolina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gnidan
Copy link
Contributor Author

gnidan commented Nov 18, 2019

Thanks!

@gnidan gnidan merged commit 1715531 into develop Nov 18, 2019
@gnidan gnidan deleted the interface-adapter-interface branch November 18, 2019 17:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants