MCPcopy Index your code
hub / github.com/ccxt/ccxt / testBinaryToBase58

Function testBinaryToBase58

ts/src/test/base/test.binaryToBase58.ts:9–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7}
8
9function testBinaryToBase58 () {
10
11 const exchange = new ccxt.Exchange ({
12 'id': 'sampleexchange',
13 });
14
15 assert (exchange.parseNumber (undefined) === undefined, 'GO skip trick');
16
17 // @SKIP_START_GO
18 // Test 1: Simple string
19 const binary1 = helperStrToBinary5 (exchange, 'hello');
20 assert (exchange.binaryToBase58 (binary1) === 'Cn8eVZg');
21
22 // Test 2: String with space
23 const binary2 = helperStrToBinary5 (exchange, 'hello world');
24 assert (exchange.binaryToBase58 (binary2) === 'StV1DL6CwTryKyV');
25
26 // Test 3: Short string
27 const binary3 = helperStrToBinary5 (exchange, 'test');
28 assert (exchange.binaryToBase58 (binary3) === '3yZe7d');
29
30 // Test 4: Single byte
31 const binary4 = helperStrToBinary5 (exchange, 'a');
32 assert (exchange.binaryToBase58 (binary4) === '2g');
33
34 // Test 5: Two bytes
35 const binary5 = helperStrToBinary5 (exchange, 'ab');
36 assert (exchange.binaryToBase58 (binary5) === '8Qq');
37
38 // Test 6: Three bytes
39 const binary6 = helperStrToBinary5 (exchange, 'abc');
40 assert (exchange.binaryToBase58 (binary6) === 'ZiCa');
41
42 // Test 7: JSON-like binary
43 const binary7 = helperStrToBinary5 (exchange, '{"key":"value"}');
44 assert (exchange.binaryToBase58 (binary7) === '4SoiMiEYtTt5tPdi81Fik');
45 // @SKIP_END_GO
46}
47
48export default testBinaryToBase58;

Callers 1

baseTestsInitFunction · 0.70

Calls 4

parseNumberMethod · 0.95
binaryToBase58Method · 0.95
helperStrToBinary5Function · 0.70
assertFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…