diff --git a/src/exchange/FixedRateExchange.ts b/src/exchange/FixedRateExchange.ts index f179c523..d77f471b 100644 --- a/src/exchange/FixedRateExchange.ts +++ b/src/exchange/FixedRateExchange.ts @@ -73,14 +73,14 @@ export class OceanFixedRateExchange { * @param {Number} rate exchange rate * @param {String} address User address * @param {String} amount Optional, amount of datatokens to be approved for the exchange - * @return {Promise} exchangeId + * @return {Promise} TransactionReceipt */ public create( dataToken: string, rate: string, address: string, amount?: string - ): SubscribablePromise { + ): SubscribablePromise { return new SubscribablePromise(async (observer) => { observer.next(FixedRateCreateProgressStep.CreatingExchange) let estGas @@ -116,7 +116,7 @@ export class OceanFixedRateExchange { observer.next(FixedRateCreateProgressStep.ApprovingDatatoken) this.datatokens.approve(dataToken, this.fixedRateExchangeAddress, amount, address) } - return exchangeId + return trxReceipt }) } diff --git a/test/unit/exchanges/FixedPriceExchange.test.ts b/test/unit/exchanges/FixedPriceExchange.test.ts index 7e150b15..d945c7dc 100644 --- a/test/unit/exchanges/FixedPriceExchange.test.ts +++ b/test/unit/exchanges/FixedPriceExchange.test.ts @@ -168,7 +168,8 @@ describe('FixedRateExchange flow', () => { if (consoleDebug) console.log('Bob ocean allowance:' + balance) }) it('Alice creates a new FixedRate Exchange with a rate of 0.5', async () => { - aliceExchangeId = await FixedRateClass.create(tokenAddress, fixedPriceRate, alice) + const trxReceipt = await FixedRateClass.create(tokenAddress, fixedPriceRate, alice) + aliceExchangeId = trxReceipt.events.ExchangeCreated.returnValues[0] if (consoleDebug) console.log('aliceExchangeId:' + aliceExchangeId) }) it('Bob should find the exchange', async () => {