1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

Merge pull request #636 from oceanprotocol/feature/improve_fre_tests

small improvement on FRE tests
This commit is contained in:
Matthias Kretschmann 2021-03-03 02:36:02 +01:00 committed by GitHub
commit d14ccf3e2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -174,6 +174,9 @@ describe('FixedRateExchange flow', () => {
const trxReceipt = await FixedRateClass.create(tokenAddress, fixedPriceRate, alice)
aliceExchangeId = trxReceipt.events.ExchangeCreated.returnValues[0]
if (consoleDebug) console.log('aliceExchangeId:' + aliceExchangeId)
const exchangeDetails = await FixedRateClass.getExchange(aliceExchangeId)
assert(exchangeDetails.fixedRate === fixedPriceRate)
assert(exchangeDetails.exchangeOwner === alice)
})
it('Bob should find the exchange', async () => {
const exchangeDetails = await FixedRateClass.searchforDT(tokenAddress, '0')
@ -214,6 +217,8 @@ describe('FixedRateExchange flow', () => {
it('Alice should update the rate', async () => {
const tx = await FixedRateClass.setRate(aliceExchangeId, updatedPriceRate, alice)
assert(tx !== null)
const exchangeDetails = await FixedRateClass.getExchange(aliceExchangeId)
assert(exchangeDetails.fixedRate === updatedPriceRate)
})
it('Alice should be able to deactivate the exchange', async () => {
const tx = await FixedRateClass.deactivate(aliceExchangeId, alice)