Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CU-86a51rqn8 - BS Lib - Multi-SEND - Fix issue where the array return… #101

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cityofzion/bs-ethereum",
"comment": "Fix issue where the array returned by transfer method is inconsistent",
"type": "patch"
}
],
"packageName": "@cityofzion/bs-ethereum"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cityofzion/bs-neo-legacy",
"comment": "Fix issue where the array returned by transfer method is inconsistent",
"type": "patch"
}
],
"packageName": "@cityofzion/bs-neo-legacy"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cityofzion/bs-neo3",
"comment": "Fix issue where the array returned by transfer method is inconsistent",
"type": "patch"
}
],
"packageName": "@cityofzion/bs-neo3"
}
7 changes: 5 additions & 2 deletions packages/bs-ethereum/src/BSEthereum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ export class BSEthereum<BSCustomName extends string = string>
const sentTransactionHashes: string[] = []

for (const intent of param.intents) {
let transactionHash = ''

try {
const { transactionParams, gasPrice } = await this.#buildTransferParams(intent)

Expand All @@ -231,11 +233,12 @@ export class BSEthereum<BSCustomName extends string = string>
maxPriorityFeePerGas: gasPrice,
maxFeePerGas: gasPrice,
})

sentTransactionHashes.push(transaction.hash)
transactionHash = transaction.hash
} catch {
/* empty */
}

sentTransactionHashes.push(transactionHash)
}

return sentTransactionHashes
Expand Down
5 changes: 3 additions & 2 deletions packages/bs-neo-legacy/src/services/BSNeoLegacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export class BSNeoLegacy<BSCustomName extends string = string>
])
}

let response
let response: any

if (nep5ScriptBuilder.isEmpty()) {
response = await api.sendAsset({
Expand All @@ -159,7 +159,8 @@ export class BSNeoLegacy<BSCustomName extends string = string>
}

if (!response.tx) throw new Error('Failed to send transaction')
return [response.tx.hash]

return intents.map(() => response.tx!.hash)
}

async claim(account: Account): Promise<string> {
Expand Down
2 changes: 1 addition & 1 deletion packages/bs-neo3/src/BSNeo3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export class BSNeo3<BSCustomName extends string = string>
signers: [],
})

return [transactionHash]
return param.intents.map(() => transactionHash)
}

async claim(account: Account, isLedger?: boolean): Promise<string> {
Expand Down
Loading