mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
use the new transfer() function
This commit is contained in:
parent
375aaed491
commit
ba34fa7627
@ -86,9 +86,7 @@
|
|||||||
|
|
||||||
/// ```Typescript
|
/// ```Typescript
|
||||||
import { assert } from 'chai'
|
import { assert } from 'chai'
|
||||||
import { AbiItem } from 'web3-utils/types'
|
|
||||||
import { SHA256 } from 'crypto-js'
|
import { SHA256 } from 'crypto-js'
|
||||||
import MockERC20 from '@oceanprotocol/contracts/artifacts/contracts/utils/mock/MockERC20Decimals.sol/MockERC20Decimals.json'
|
|
||||||
import {
|
import {
|
||||||
AmountsOutMaxFee,
|
AmountsOutMaxFee,
|
||||||
approve,
|
approve,
|
||||||
@ -111,6 +109,7 @@ import {
|
|||||||
ProviderFees,
|
ProviderFees,
|
||||||
ProviderInstance,
|
ProviderInstance,
|
||||||
TokenInOutMarket,
|
TokenInOutMarket,
|
||||||
|
transfer,
|
||||||
ZERO_ADDRESS
|
ZERO_ADDRESS
|
||||||
} from '../../src'
|
} from '../../src'
|
||||||
import { getAddresses, getTestConfig, web3 } from '../config'
|
import { getAddresses, getTestConfig, web3 } from '../config'
|
||||||
@ -231,18 +230,8 @@ describe('Marketplace flow tests', async () => {
|
|||||||
|
|
||||||
it('5.3 We send some OCEAN to consumer and staker accounts', async () => {
|
it('5.3 We send some OCEAN to consumer and staker accounts', async () => {
|
||||||
/// ```Typescript
|
/// ```Typescript
|
||||||
const oceanContract = new web3.eth.Contract(
|
transfer(web3, publisherAccount, addresses.Ocean, consumerAccount, '100')
|
||||||
MockERC20.abi as AbiItem[],
|
transfer(web3, publisherAccount, addresses.Ocean, stakerAccount, '100')
|
||||||
addresses.Ocean
|
|
||||||
)
|
|
||||||
|
|
||||||
await oceanContract.methods
|
|
||||||
.transfer(consumerAccount, web3.utils.toWei('100'))
|
|
||||||
.send({ from: publisherAccount })
|
|
||||||
|
|
||||||
await oceanContract.methods
|
|
||||||
.transfer(stakerAccount, web3.utils.toWei('100'))
|
|
||||||
.send({ from: publisherAccount })
|
|
||||||
}) ///
|
}) ///
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user