Skip to content

Commit ab8cdcf

Browse files
committed
feat: fee token
integration tests
1 parent 4fa046a commit ab8cdcf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2719
-434
lines changed

__tests__/__fixtures__/sample_txs.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ export const nftCreationTx = {
44
weight: 8.000001,
55
timestamp: 1656543561,
66
is_voided: false,
7+
signalBits: 0,
8+
nonce: 0,
79
inputs: [
810
{
911
value: 100n,
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import { NATIVE_TOKEN_UID } from '../../src/constants';
2+
import { TokenVersion, ITokenData, ITokenMetadata } from '../../src/types';
3+
4+
export const mockGetToken = async (
5+
tokenUid: string
6+
): Promise<ITokenData & Partial<ITokenMetadata>> => {
7+
const tokenMap: Record<string, ITokenData> = {
8+
[NATIVE_TOKEN_UID]: {
9+
version: TokenVersion.NATIVE,
10+
uid: NATIVE_TOKEN_UID,
11+
symbol: 'HTR',
12+
name: 'Hathor',
13+
},
14+
'01': {
15+
version: TokenVersion.DEPOSIT,
16+
uid: '01',
17+
symbol: 'TKN01',
18+
name: 'Token 01',
19+
},
20+
'02': {
21+
version: TokenVersion.FEE,
22+
uid: '02',
23+
symbol: 'FBT',
24+
name: 'Fee Based Token',
25+
},
26+
dbt: {
27+
version: TokenVersion.DEPOSIT,
28+
uid: 'dbt',
29+
symbol: 'DBT',
30+
name: 'Deposit Based Token',
31+
},
32+
fbt: {
33+
version: TokenVersion.FEE,
34+
uid: 'fbt',
35+
symbol: 'FBT',
36+
name: 'Fee Based Token',
37+
},
38+
};
39+
40+
return tokenMap[tokenUid];
41+
};

__tests__/integration/configuration/docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ services:
88

99
fullnode:
1010
image:
11-
${HATHOR_LIB_INTEGRATION_TESTS_FULLNODE_IMAGE:-hathornetwork/hathor-core:v0.67.0}
11+
${HATHOR_LIB_INTEGRATION_TESTS_FULLNODE_IMAGE:-hathornetwork/hathor-core:experimental-push_fee_header}
12+
# hathor-core:local
1213
command: [
1314
"run_node",
1415
"--listen", "tcp:40404",
@@ -40,6 +41,7 @@ services:
4041
retries: 10
4142

4243
tx-mining-service:
44+
platform: linux/amd64
4345
image:
4446
${HATHOR_LIB_INTEGRATION_TESTS_TXMINING_IMAGE:-hathornetwork/tx-mining-service}
4547
depends_on:

__tests__/integration/configuration/privnet.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ CHECKPOINTS: []
3131

3232
ENABLE_NANO_CONTRACTS: enabled
3333
NC_ON_CHAIN_BLUEPRINT_RESTRICTED: false
34-
AVG_TIME_BETWEEN_BLOCKS: 5
34+
AVG_TIME_BETWEEN_BLOCKS: 1
35+
FEE_PER_OUTPUT: 1
3536

3637
extends: mainnet.yml

0 commit comments

Comments
 (0)