Skip to content

Commit 10aded2

Browse files
authored
fix(finance): adjust min length of generated bitcoin address (#1384)
1 parent fe97c29 commit 10aded2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/modules/finance/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,10 @@ export class FinanceModule {
235235

236236
let address = this.faker.helpers.arrayElement(['1', '3']);
237237

238-
for (let i = 0; i < addressLength - 1; i++)
239-
address += this.faker.helpers.arrayElement(
240-
'123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ'.split('')
241-
);
238+
address += this.faker.random.alphaNumeric(addressLength, {
239+
casing: 'mixed',
240+
bannedChars: '0OIl',
241+
});
242242

243243
return address;
244244
}

test/__snapshots__/finance.spec.ts.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exports[`finance > 42 > bic > noArgs 1`] = `"UYETSCLL"`;
2020

2121
exports[`finance > 42 > bic > with branch code 1`] = `"JUYEPSSL5G5"`;
2222

23-
exports[`finance > 42 > bitcoinAddress 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1bZb"`;
23+
exports[`finance > 42 > bitcoinAddress 1`] = `"3XbJMAAara64sSkA9HD24YHQWd1bZbB"`;
2424

2525
exports[`finance > 42 > creditCardCVV 1`] = `"379"`;
2626

@@ -86,7 +86,7 @@ exports[`finance > 1211 > bic > noArgs 1`] = `"LXUFBTZ15O7"`;
8686

8787
exports[`finance > 1211 > bic > with branch code 1`] = `"YLXUDE4ZXXX"`;
8888

89-
exports[`finance > 1211 > bitcoinAddress 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsAUc9n"`;
89+
exports[`finance > 1211 > bitcoinAddress 1`] = `"1TMe8Z3EaFdLqmaGKP1LEEJQVriSZRZdsAUc9nC"`;
9090

9191
exports[`finance > 1211 > creditCardCVV 1`] = `"948"`;
9292

@@ -152,7 +152,7 @@ exports[`finance > 1337 > bic > noArgs 1`] = `"OEFHLYG1"`;
152152

153153
exports[`finance > 1337 > bic > with branch code 1`] = `"GOEFFIJGXXX"`;
154154

155-
exports[`finance > 1337 > bitcoinAddress 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZar"`;
155+
exports[`finance > 1337 > bitcoinAddress 1`] = `"3adhxs2jewAgkYgJi7No6Cn8JZarS"`;
156156

157157
exports[`finance > 1337 > creditCardCVV 1`] = `"251"`;
158158

0 commit comments

Comments
 (0)