Skip to content

Commit 92c7349

Browse files
committed
wip: rm duplicate function
1 parent 220b614 commit 92c7349

File tree

2 files changed

+2
-11
lines changed

2 files changed

+2
-11
lines changed

packages/transact/tests/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const readTestDataFile = (filename: string): RawTestData => {
2525
}
2626

2727
// Helper to decode base64 to Uint8Array
28-
const base64ToUint8Array = (base64: string): Uint8Array => {
28+
export const base64ToUint8Array = (base64: string): Uint8Array => {
2929
const binaryString = atob(base64)
3030
const bytes = new Uint8Array(binaryString.length)
3131
for (let i = 0; i < binaryString.length; i++) {

packages/transact/tests/transaction_group.test.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as fs from 'fs'
22
import * as path from 'path'
33
import { describe, expect, test } from 'vitest'
44
import { decodeSignedTransaction, encodeSignedTransactions, encodeTransactionRaw, groupTransactions, Transaction } from '../src'
5-
import { testData } from './common'
5+
import { base64ToUint8Array, testData } from './common'
66

77
const dataDir = path.join(__dirname, 'polytest_resources/data-factory/data')
88

@@ -13,15 +13,6 @@ type TxGroupTestData = {
1313
txns: string[]
1414
}
1515

16-
const base64ToUint8Array = (base64: string): Uint8Array => {
17-
const binaryString = atob(base64)
18-
const bytes = new Uint8Array(binaryString.length)
19-
for (let i = 0; i < binaryString.length; i++) {
20-
bytes[i] = binaryString.charCodeAt(i)
21-
}
22-
return bytes
23-
}
24-
2516
const txGroupData: TxGroupTestData = JSON.parse(fs.readFileSync(path.join(dataDir, 'txGroup.json'), 'utf-8'))
2617

2718
const expectedTxnBlobs = txGroupData.txnBlobs.map(base64ToUint8Array)

0 commit comments

Comments
 (0)