mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
small improvement on FRE tests
This commit is contained in:
parent
5b43fe8846
commit
52687d4bc4
@ -174,6 +174,9 @@ describe('FixedRateExchange flow', () => {
|
|||||||
const trxReceipt = await FixedRateClass.create(tokenAddress, fixedPriceRate, alice)
|
const trxReceipt = await FixedRateClass.create(tokenAddress, fixedPriceRate, alice)
|
||||||
aliceExchangeId = trxReceipt.events.ExchangeCreated.returnValues[0]
|
aliceExchangeId = trxReceipt.events.ExchangeCreated.returnValues[0]
|
||||||
if (consoleDebug) console.log('aliceExchangeId:' + aliceExchangeId)
|
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 () => {
|
it('Bob should find the exchange', async () => {
|
||||||
const exchangeDetails = await FixedRateClass.searchforDT(tokenAddress, '0')
|
const exchangeDetails = await FixedRateClass.searchforDT(tokenAddress, '0')
|
||||||
@ -214,6 +217,8 @@ describe('FixedRateExchange flow', () => {
|
|||||||
it('Alice should update the rate', async () => {
|
it('Alice should update the rate', async () => {
|
||||||
const tx = await FixedRateClass.setRate(aliceExchangeId, updatedPriceRate, alice)
|
const tx = await FixedRateClass.setRate(aliceExchangeId, updatedPriceRate, alice)
|
||||||
assert(tx !== null)
|
assert(tx !== null)
|
||||||
|
const exchangeDetails = await FixedRateClass.getExchange(aliceExchangeId)
|
||||||
|
assert(exchangeDetails.fixedRate === updatedPriceRate)
|
||||||
})
|
})
|
||||||
it('Alice should be able to deactivate the exchange', async () => {
|
it('Alice should be able to deactivate the exchange', async () => {
|
||||||
const tx = await FixedRateClass.deactivate(aliceExchangeId, alice)
|
const tx = await FixedRateClass.deactivate(aliceExchangeId, alice)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user