Closed bent0b0x closed 6 years ago
@jellegerbrandy would you be able to assist with this?
A webdriver.io
command that we could run to set the user's PTI balance would be great, but if we cannot do that a util to just add (and then maybe even detract?) balance works.
I tried to wire something up but failed, due to lack of understanding. How do we, in the browser, execute a script that reconfigures paratii-js
to be using the main account? And then successfully reconfigure it to use the test user's account.
Hey ben, so this is not something i would do in the browser, but simply diretly in the test code. So it works like this (and probably we are using that pattern already in some tests):
const testSettings = thoseSettingsThatAreUsedInSetupDevEnvThatUse0xCbe...
const paratiiFor0xCbe - new Paratii(testSettings)
await paratiiFor0xCBe.eth.transfer(2e18, 'PTI')
so to answer there is no need to set the account on the paratii object: we can use different instances of paratii instead
Right now if we want to test functionality that requires PTI we do not have a nice util to make this simple.
For example, this is required to write integration tests for tipping, as most of the core of the tipping functionality requires PTI.