Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and deprecate ChainSetup and setup helpers #62

Merged
merged 28 commits into from
Feb 12, 2019

Conversation

hobofan
Copy link
Contributor

@hobofan hobofan commented Feb 6, 2019

  • AnchorHelper
  • GatewayHelper
  • CoGatewayHelper
  • OrganizationHelper
  • LibsHelper
  • OSTPrimeHelper
  • make sure that the config keys are up to date (e.g. valueToken, members)
  • docs for all of the above
  • remove test for LibsHelper.setup

FIXES #58 and starts deprecation of ChainSetup as per #57

@hobofan hobofan changed the title [WIP] Refactor and deprecate ChainSetup and setup helpers Refactor and deprecate ChainSetup and setup helpers Feb 7, 2019
Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

Looks very promising ✨ Still some way to go, though.

Almost all JSDocs are missing 😞

src/ContractInteract/Anchor.js Outdated Show resolved Hide resolved
src/ContractInteract/Anchor.js Show resolved Hide resolved
src/ContractInteract/Anchor.js Show resolved Hide resolved
src/ContractInteract/Anchor.js Outdated Show resolved Hide resolved
src/ContractInteract/EIP20CoGateway.js Outdated Show resolved Hide resolved
src/ContractInteract/validation.js Outdated Show resolved Hide resolved
src/helpers/setup/AnchorHelper.js Outdated Show resolved Hide resolved
src/utils/Utils.js Show resolved Hide resolved
test_integration/01_chain_setup/01_chain_setup.js Outdated Show resolved Hide resolved
test_integration/02_sequential_setup/01_libs_helper.js Outdated Show resolved Hide resolved
@deepesh-kn
Copy link
Collaborator

I did a quick scan, I like the approach 👍. I will go through this again once it is completed.

@hobofan hobofan force-pushed the refactor_chain_setup branch 2 times, most recently from b9cb47d to 2e480b3 Compare February 11, 2019 09:51
src/ContractInteract/Anchor.js Outdated Show resolved Hide resolved
src/ContractInteract/Anchor.js Show resolved Hide resolved
@hobofan hobofan force-pushed the refactor_chain_setup branch 2 times, most recently from ab1c998 to 459078a Compare February 11, 2019 10:55
Copy link
Collaborator

@deepesh-kn deepesh-kn left a comment

Choose a reason for hiding this comment

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

Overall looks good to me: 👍
I just have few comments in general

  • The txOptions are not used in the RawTx methods.
  • The errors do not include the value (@schemar do we need this in PR? or can a ticket will do for later change?).
  • Maybe we should move the static methods to be end of the class.

src/ContractInteract/validation.js Outdated Show resolved Hide resolved
src/ContractInteract/Anchor.js Outdated Show resolved Hide resolved
src/ContractInteract/Anchor.js Show resolved Hide resolved
src/ContractInteract/Anchor.js Outdated Show resolved Hide resolved
src/ContractInteract/Anchor.js Outdated Show resolved Hide resolved
src/helpers/setup/CoGatewayHelper.js Show resolved Hide resolved
src/helpers/setup/GatewayHelper.js Outdated Show resolved Hide resolved
Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

😳 big one. Good work 💪
I still have some questions.

Are the setup helpers changes backwards compatible?
Why do the integration tests still use the helpers, when we can use the contract interacts now to setup the contracts? Wasn't that the plan?

src/ChainSetup.js Show resolved Hide resolved
src/ContractInteract/Anchor.js Outdated Show resolved Hide resolved
src/ContractInteract/Anchor.js Outdated Show resolved Hide resolved
src/ContractInteract/Anchor.js Outdated Show resolved Hide resolved
src/ContractInteract/EIP20CoGateway.js Show resolved Hide resolved
src/ContractInteract/validation.js Outdated Show resolved Hide resolved
src/helpers/setup/CoGatewayHelper.js Show resolved Hide resolved
src/utils/Utils.js Show resolved Hide resolved
test_integration/01_sequential_setup/01_libs_helper.js Outdated Show resolved Hide resolved
@schemar
Copy link
Contributor

schemar commented Feb 11, 2019

Overall looks good to me: 👍
I just have few comments in general

* The `txOptions` are not used in the RawTx methods.

* The errors do not include the value (@schemar do we need this in PR? or can a ticket will do for later change?).

I don't know. Depends on the effort.

* Maybe we should move the static methods to be end of the class.

@hobofan
Copy link
Contributor Author

hobofan commented Feb 11, 2019

Why do the integration tests still use the helpers, when we can use the contract interacts now to setup the contracts? Wasn't that the plan?

-> #99

Copy link
Collaborator

@deepesh-kn deepesh-kn left a comment

Choose a reason for hiding this comment

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

This looks good. 🚴🚴🚴🚴🚴

I have added few small comments. Either we can fix if its small or create can create a followup ticket. 👍

1.Validations of txOptions and txOptions.from is missing for all the deploy methods.

2.Unit tests for the following is missing, maybe we can create a followup ticket.

Anchor:
- setCoAnchorAddress
- setCoAnchorAddressRawTx

EIP20Gateway:
- getStakeVault
- activateGateway
- activateGatewayRawTx

OSTPrime:
- initialize
- initializeRawTx
- setCoGateway
- setCoGatewayRawTx

3.All the integration tests of new code is in old helper files, that confused me alot.

src/ContractInteract/EIP20Gateway.js Outdated Show resolved Hide resolved
src/ContractInteract/EIP20Gateway.js Show resolved Hide resolved
src/ContractInteract/EIP20Gateway.js Outdated Show resolved Hide resolved
src/ContractInteract/GatewayLib.js Outdated Show resolved Hide resolved
src/ContractInteract/MerklePatriciaProof.js Outdated Show resolved Hide resolved
src/ContractInteract/OSTPrime.js Outdated Show resolved Hide resolved
shared.origin.addresses.Organization = subject.address;
});

return Organization.setup(shared.origin.web3, _orgConfig).then(
Copy link
Collaborator

Choose a reason for hiding this comment

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

What is difference in this test and after()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

origin and auxiliary. In after, we deploy an Organization on auxiliary to be used by later tests.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Adding a comment will be helpful.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a comment to the after.

@hobofan
Copy link
Contributor Author

hobofan commented Feb 12, 2019

2.Unit tests for the following is missing, maybe we can create a followup ticket.

#108

3.All the integration tests of new code is in old helper files, that confused me alot.

There is a related ticket: #99

Copy link
Collaborator

@deepesh-kn deepesh-kn left a comment

Choose a reason for hiding this comment

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

LGTM 🎢 👍

Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

Only two small open points ✨

Copy link
Contributor

@schemar schemar left a comment

Choose a reason for hiding this comment

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

makeitso

@hobofan hobofan merged commit 2e0c1f1 into develop Feb 12, 2019
@benjaminbollen benjaminbollen deleted the refactor_chain_setup branch March 28, 2019 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants