Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Update test cases and config file, removing ccuFee = 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Phanco committed Nov 24, 2023
1 parent 06e7b82 commit e6a7c5d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
"chainConnector": {
"receivingChainID": "04000001",
"encryptedPrivateKey": "kdf=argon2id&cipher=aes-128-gcm&version=1&ciphertext=aa92aefc87797b8e107e0ebc8f863333b8dbc173b7d6e75b0f3ca1f5113d64050247a2c79679840193ea564a34c80f7e3d8ff77d5a9a2cd7e9c1e912e707b38206d4700485013ae14e33db2e31f4f0cfeee5fdbe4e2356cce179819f87da348cf2fe057f6e320b809db3ffdad7cbae86c568184caebe3ba44edb49c59e263012&mac=e4d31ce6274e3dd83c70732f9965846114d53e07e831b1f5bb9a841e1731d85a&salt=a3fd8ab81c91b9b5&iv=c3028fe54417f71e1caba5727be0040d&tag=f97a0df7b6349f90310ebf3eed4dde42&iterations=1&parallelism=4&memorySize=2097023",
"ccuFee": "0",
"receivingChainIPCPath": "~/.lisk/pos-sidechain-example-one",
"registrationHeight": 10
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"chainConnector": {
"receivingChainID": "04000000",
"encryptedPrivateKey": "kdf=argon2id&cipher=aes-128-gcm&version=1&ciphertext=c91b8dc71310bd3cdb28061ed3cad59044e16c7ecce1fc22259428c83314d8f55d4b32c1ee1fec519fdb614b52ef3f9388ae0da092b1caf0d519ed33a1d63d4105e366e8bf44f857252e738f19b5befc047acebc9a69cc196cac8521a9e64ecee93520c5ac04e124229a33e8dff97f13d78b4980cbe74d09596f37b299373729&mac=fea49a78aaa02d2c1fdc075737ab63be41e0f7f4beda7bacfda39acfbcc70647&salt=55107ca75dbf6f50&iv=bf7696ce4e1a0a64cf88af35f7028aae&tag=411573e9fdf474df43b022d321219b7d&iterations=1&parallelism=4&memorySize=2097023",
"ccuFee": "0",
"receivingChainIPCPath": "~/.lisk/mainchain-node-one",
"registrationHeight": 10
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1064,7 +1064,7 @@ describe('ChainConnectorPlugin', () => {
.mockResolvedValue(initializationFees);
});

it('should return config.ccuFee + additionalFee when ccuFee exists', async () => {
it('should return config.ccuFee + additionalFee when config.ccuFee exists', async () => {
await initChainConnectorPlugin(chainConnectorPlugin, defaultConfig);
await expect(chainConnectorPlugin['_getCcuFee'](transactionTemplate)).resolves.toBe(
BigInt(defaultCCUFee) + initializationFees.userAccount,
Expand Down Expand Up @@ -1094,7 +1094,7 @@ describe('ChainConnectorPlugin', () => {
});
});

it('should return config.ccuFee when ccuFee exists', async () => {
it('should return config.ccuFee when config.ccuFee exists', async () => {
await initChainConnectorPlugin(chainConnectorPlugin, defaultConfig);
await expect(chainConnectorPlugin['_getCcuFee'](transactionTemplate)).resolves.toBe(
BigInt(defaultCCUFee),
Expand Down Expand Up @@ -1803,6 +1803,11 @@ describe('ChainConnectorPlugin', () => {
})
.calledWith('auth_getAuthAccount', expect.anything())
.mockResolvedValue({ nonce: '3' });
when(sendingChainAPIClientMock.invoke)
.calledWith('token_hasUserAccount', expect.anything())
.mockResolvedValue({
exists: true,
});

await chainConnectorPlugin['_submitCCU'](sampleCCUParams);
});
Expand All @@ -1821,7 +1826,22 @@ describe('ChainConnectorPlugin', () => {
expect(sendingChainAPIClientMock.invoke).toHaveBeenCalledWith('txpool_postTransaction', {
transaction: expect.any(String),
});
expect(sendingChainAPIClientMock.invoke).toHaveBeenCalledTimes(3);
expect(sendingChainAPIClientMock.invoke).toHaveBeenNthCalledWith(
1,
'auth_getAuthAccount',
expect.anything(),
);
expect(sendingChainAPIClientMock.invoke).toHaveBeenNthCalledWith(2, 'system_getNodeInfo');
expect(sendingChainAPIClientMock.invoke).toHaveBeenNthCalledWith(
3,
'token_hasUserAccount',
expect.anything(),
);
expect(sendingChainAPIClientMock.invoke).toHaveBeenNthCalledWith(
4,
'txpool_postTransaction',
expect.anything(),
);
});
});
});

0 comments on commit e6a7c5d

Please sign in to comment.