-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: increase coverage of test cases
- Loading branch information
Showing
21 changed files
with
273 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default [ | ||
{ | ||
testName: 'ESTIMATE_FEE success - mainnet', | ||
result: { | ||
lovelacePerByte: 44, | ||
}, | ||
}, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export default [ | ||
{ | ||
testName: 'GET_ACCOUNT_INFO success - mainnet', | ||
descriptor: '6d17587575a3b4f0f86ebad3977e8f7e4981faa863eccf5c1467065c74fe3435943769446dd290d103fb3d360128e86de4b47faea73ffb0900c94c6a61ef9ea2', | ||
details: 'basic', | ||
page: 1, | ||
pageSize: 25, | ||
result: { | ||
"descriptor": "6d17587575a3b4f0f86ebad3977e8f7e4981faa863eccf5c1467065c74fe3435943769446dd290d103fb3d360128e86de4b47faea73ffb0900c94c6a61ef9ea2", | ||
"empty": true, | ||
"balance": "0", | ||
"availableBalance": "0", | ||
"tokens": [], | ||
"history": { | ||
"total": 0, | ||
"unconfirmed": 0 | ||
}, | ||
"page": { | ||
"index": 1, | ||
"size": 25, | ||
"total": 0 | ||
}, | ||
"misc": { | ||
"staking": { | ||
"address": "stake_test1uzzutrtmxwv2rf2j3hdpps66ch0jydmkr58vwgnetddcdwgkqkh89", | ||
"rewards": "0", | ||
"isActive": false, | ||
"poolId": null | ||
} | ||
} | ||
}, | ||
}, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { expect } from 'vitest'; | ||
|
||
export default [ | ||
{ | ||
testName: 'GET_SERVER success - preprod', | ||
result: { | ||
name: 'Cardano', | ||
shortcut: 'tada', | ||
testnet: true, | ||
version: '2.2.3', | ||
decimals: 6, | ||
blockHeight: expect.any(Number), | ||
blockHash: expect.stringMatching(/^[a-f0-9]{64}$/), | ||
}, | ||
}, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default [ | ||
{ | ||
testName: 'ESTIMATE-fee success - preprod', | ||
result: { | ||
lovelacePerByte: 44, | ||
}, | ||
}, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
export default [ | ||
{ | ||
testName: 'GET_ACCOUNT_INFO success - preprod', | ||
descriptor: '6d17587575a3b4f0f86ebad3977e8f7e4981faa863eccf5c1467065c74fe3435943769446dd290d103fb3d360128e86de4b47faea73ffb0900c94c6a61ef9ea2', | ||
details: 'basic', | ||
page: 1, | ||
pageSize: 25, | ||
result: { | ||
"descriptor": "6d17587575a3b4f0f86ebad3977e8f7e4981faa863eccf5c1467065c74fe3435943769446dd290d103fb3d360128e86de4b47faea73ffb0900c94c6a61ef9ea2", | ||
"empty": true, | ||
"balance": "0", | ||
"availableBalance": "0", | ||
"tokens": [], | ||
"history": { | ||
"total": 0, | ||
"unconfirmed": 0 | ||
}, | ||
"page": { | ||
"index": 1, | ||
"size": 25, | ||
"total": 0 | ||
}, | ||
"misc": { | ||
"staking": { | ||
"address": "stake_test1uzzutrtmxwv2rf2j3hdpps66ch0jydmkr58vwgnetddcdwgkqkh89", | ||
"rewards": "0", | ||
"isActive": false, | ||
"poolId": null | ||
} | ||
} | ||
}, | ||
}, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default [ | ||
{ | ||
testName: 'GET_ACCOUNT_UTXO success - preprod', | ||
descriptor: '6d17587575a3b4f0f86ebad3977e8f7e4981faa863eccf5c1467065c74fe3435943769446dd290d103fb3d360128e86de4b47faea73ffb0900c94c6a61ef9ea2', | ||
result: [], | ||
}//TODO more examples | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { expect } from 'vitest'; | ||
|
||
export default [ | ||
{ | ||
testName: 'GET_BLOCK success - preprod', | ||
result: { | ||
"block_vrf": "vrf_vk1suxu5crrj7u96tjwu8jxhkum0p9qj2s7cfwts9rv7szxg4hlscwqg9ljpt", | ||
"confirmations": expect.any(Number), | ||
"epoch": 176, | ||
"epoch_slot": 307781, | ||
"fees": "4449834", | ||
"hash": "8b41ba36539ce5f72ec5e6792dfa125ba60126443c7d2d6452f71e5f7d410cfc", | ||
"height": 2839412, | ||
"next_block": "83139f88a06c4ff66c395b3603f98c69f2f3732189cc5e187d6ce19bb778eb0d", | ||
"op_cert": "a3727c534ed0bef79c124d6754c528f162e012c37069b7f6b4473e2d1262daed", | ||
"op_cert_counter": "12", | ||
"output": "48648336745", | ||
"previous_block": "e72a3d503fbe6a7abaf68ab1093a03a244912fd6fa921f4e62f0661f7f239256", | ||
"size": 29246, | ||
"slot": 74698181, | ||
"slot_leader": "pool1upqfyzqpk6wkpsvw90qqrpr9tjyemh484wk4em69anwpu586ehq", | ||
"time": 1730381381, | ||
"tx_count": 9 | ||
}, | ||
}, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default [ | ||
{ | ||
testName: 'PUSH_TRANSACTION success - preprod', | ||
}, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export default [ | ||
{ | ||
testName: 'GET_SERVER success - preprod', | ||
result: { | ||
"subscribed": true, | ||
}, | ||
}, | ||
] as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { describe, expect, test } from 'vitest'; | ||
import { getFixtures } from '../utils/fixtures-loader'; | ||
import { WebsocketClientE2e } from '../utils/websocket-client-e2e'; | ||
|
||
const fixtures = await getFixtures('estimate-fee'); | ||
|
||
describe('estimate-fee', () => { | ||
const ws = new WebsocketClientE2e('ws://localhost:3005'); | ||
|
||
for (const fixture of fixtures) { | ||
test(fixture.testName, async () => { | ||
await ws.waitForConnection(); | ||
const { data } = await ws.sendAndWait('ESTIMATE_FEE'); | ||
expect(data).toMatchObject(fixture.result); | ||
await ws.close(); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { describe, expect, test } from 'vitest'; | ||
import { getFixtures } from '../utils/fixtures-loader'; | ||
import { WebsocketClientE2e } from '../utils/websocket-client-e2e'; | ||
|
||
const fixtures = await getFixtures('get-account-info'); | ||
|
||
describe('get-account-info', () => { | ||
const ws = new WebsocketClientE2e('ws://localhost:3005'); | ||
|
||
for (const fixture of fixtures) { | ||
test(fixture.testName, async () => { | ||
await ws.waitForConnection(); | ||
const { data } = await ws.sendAndWait('GET_ACCOUNT_INFO', { | ||
descriptor: fixture.descriptor, | ||
details: fixture.details, | ||
page: fixture.page, | ||
pageSize: fixture.pageSize, | ||
}); | ||
|
||
expect(data).toMatchObject(fixture.result); | ||
await ws.close(); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { describe, expect, test } from 'vitest'; | ||
import { getFixtures } from '../utils/fixtures-loader'; | ||
import { WebsocketClientE2e } from '../utils/websocket-client-e2e'; | ||
|
||
const fixtures = await getFixtures('get-account-utxo'); | ||
|
||
describe('get-account-utxo', () => { | ||
const ws = new WebsocketClientE2e('ws://localhost:3005'); | ||
|
||
for (const fixture of fixtures) { | ||
test(fixture.testName, async () => { | ||
await ws.waitForConnection(); | ||
const { data } = await ws.sendAndWait('GET_ACCOUNT_UTXO', { | ||
descriptor: fixture.descriptor, | ||
}); | ||
|
||
expect(data).toMatchObject(fixture.result); | ||
await ws.close(); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { describe, expect, test } from 'vitest'; | ||
import { getFixtures } from '../utils/fixtures-loader'; | ||
import { WebsocketClientE2e } from '../utils/websocket-client-e2e'; | ||
|
||
const fixtures = await getFixtures('get-block'); | ||
|
||
describe('get-block', () => { | ||
const ws = new WebsocketClientE2e('ws://localhost:3005'); | ||
|
||
for (const fixture of fixtures) { | ||
test(fixture.testName, async () => { | ||
await ws.waitForConnection(); | ||
const { data } = await ws.sendAndWait('GET_BLOCK', { hashOrNumber: '8b41ba36539ce5f72ec5e6792dfa125ba60126443c7d2d6452f71e5f7d410cfc' }); | ||
expect(data).toMatchObject(fixture.result); | ||
await ws.close(); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { describe, expect, test } from 'vitest'; | ||
import { WebsocketClientE2e } from '../utils/websocket-client-e2e'; | ||
import { buildTx } from '../tx-builder'; | ||
import { getFixtures } from '../utils/fixtures-loader'; | ||
|
||
|
||
const fixtures = await getFixtures('push-transaction'); | ||
|
||
describe('push-transaction', () => { | ||
const ws = new WebsocketClientE2e('ws://localhost:3005', true); | ||
|
||
for (const fixture of fixtures) { | ||
test('PUSH_TRANSACTION', async () => { | ||
await ws.waitForConnection(); | ||
const receivingAddress = | ||
'addr_test1qq4wgdp3xw29d6ewuv9cvx83h9v0d5sy8lntd8vrdtrsfykwfnd2ewysca99vdwkvpp6a8w9nv5u4srvw5k0ywtl3v8qrl4qwp'; | ||
const { transaction, txHash } = await buildTx('1000000', receivingAddress); | ||
const resposne = await ws.sendAndWait('PUSH_TRANSACTION', { | ||
txData: transaction.to_hex(), | ||
}); | ||
|
||
expect(resposne.data).toMatchObject(txHash); | ||
await ws.close(); | ||
}); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters