diff --git a/packages/jellyfish-api-core/__tests__/category/account.test.ts b/packages/jellyfish-api-core/__tests__/category/account.test.ts index 82ece7d9b4..cd708bd95f 100644 --- a/packages/jellyfish-api-core/__tests__/category/account.test.ts +++ b/packages/jellyfish-api-core/__tests__/category/account.test.ts @@ -482,19 +482,11 @@ describe('masternode', () => { }) describe('utxosToAccount', () => { - let address1: string - let address2: string - - beforeAll(async () => { - address1 = await container.call('getnewaddress') - address2 = await container.call('getnewaddress') - }) - it('should utxosToAccount', async () => { const payload: UtxosToAccountPayload = {} // NOTE(jingyi2811): Only support sending utxos to DFI account. - payload[address1] = '5@DFI' - payload[address2] = '5@DFI' + payload[await container.getNewAddress()] = '5@DFI' + payload[await container.getNewAddress()] = '5@DFI' const data = await client.account.utxosToAccount(payload) @@ -505,8 +497,8 @@ describe('masternode', () => { it('should utxosToAccount with utxos', async () => { const payload: UtxosToAccountPayload = {} // NOTE(jingyi2811): Only support sending utxos to DFI account. - payload[address1] = '5@DFI' - payload[address2] = '5@DFI' + payload[await container.getNewAddress()] = '5@DFI' + payload[await container.getNewAddress()] = '5@DFI' const utxos = await container.call('listunspent') const inputs = utxos.map((utxo: { txid: string, vout: number }) => { diff --git a/packages/jellyfish-api-core/src/category/account.ts b/packages/jellyfish-api-core/src/category/account.ts index 39951377c3..9871799ff0 100644 --- a/packages/jellyfish-api-core/src/category/account.ts +++ b/packages/jellyfish-api-core/src/category/account.ts @@ -222,8 +222,8 @@ export class Account { } /** - * Creates (and submits to local node and network) a transfer transaction from the wallet UTXOs to specfied account. - * The second optional argument (may be empty array) is an array of specific UTXOs to spend. + * Creates and submits to a connect node; a transfer transaction from the wallet UTXOs to a specified account. + * Optionally, specific UTXOs to spend to create that transaction. * * @param {UtxosToAccountPayload} payload * @param {string} payload[address] diff --git a/website/docs/jellyfish/api/account.md b/website/docs/jellyfish/api/account.md index a4c0ab422a..72b74558ae 100644 --- a/website/docs/jellyfish/api/account.md +++ b/website/docs/jellyfish/api/account.md @@ -145,8 +145,8 @@ interface AccountHistoryOptions { ## utxosToAccount -Creates (and submits to local node and network) a transfer transaction from the wallet UTXOs to specfied account. -The second optional argument (may be empty array) is an array of specific UTXOs to spend. +Creates and submits to a connect node; a transfer transaction from the wallet UTXOs to a specified account. +Optionally, specific UTXOs to spend to create that transaction. ```ts title="client.account.utxosToAccount()" interface account {