-
Notifications
You must be signed in to change notification settings - Fork 237
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
Improve web3 options handling and single loadContracts #245
Conversation
📦 PR PackagesInstall this PR: yarn add @superfluid-finance/js-sdk@PR245 --registry https://npm.pkg.github.com/
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, just a few comments for my own understanding
if (from) { | ||
console.log("Set default from address to", from); | ||
} else { | ||
const accounts = await web3.eth.getAccounts(); | ||
from = accounts[0]; | ||
console.log( | ||
"Set default from address to the first account", | ||
from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I didn't want to do this, is b/c I thought maybe a test will want to change from
after the contract is loaded. If thats not the case then this is ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
each transaction can always use the non-default from address.
this was added because it seems otherwise the deployment scripts didn't work...
}); | ||
} catch (e) { | ||
throw Error( | ||
`could not load non-truffle environment contracts. ${e}` | ||
); | ||
} | ||
} else { | ||
} else if (isTruffle) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you add back isTruffle
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to have an explicit error thrown on unknown mode.
this.isTruffle = isTruffle; | ||
this.ethers = ethers; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no longer can deploy test environment with ethers?
* | ||
* Usage: npx truffle exec scripts/reset-deployment.js : {VERSION} | ||
*/ | ||
module.exports = async function(callback, argv) { | ||
try { | ||
global.web3 = web3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah maybe this is why ethers test were failing
const config = Superfluid.getConfig(chainId); | ||
console.log("reset: ", reset); | ||
console.log("chain ID: ", chainId); | ||
eval(`(${detectTruffleAndConfigure.toString()})(options)`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is scary
No description provided.