-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1645721
commit 75ffe95
Showing
4 changed files
with
208 additions
and
0 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 @@ | ||
import * as BlockchainClient from '~/libraries/BlockchainClient/BlockchainClient' | ||
|
||
describe.skip('BlockchainClient.default.getInstance', () => { //skipped due to the local env | ||
test('0', () => { | ||
const result: any = BlockchainClient.default.getInstance() | ||
expect(result).toMatchSnapshot() | ||
}) | ||
}) |
119 changes: 119 additions & 0 deletions
119
libraries/BlockchainClient/__snapshots__/BlockchainClient.test.ts.snap
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,119 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`BlockchainClient.default.getInstance 0 1`] = ` | ||
BlockchainClient { | ||
"adapter": SolanaAdapter { | ||
"_friendsProgram": null, | ||
"groupsProgram": null, | ||
"solanaManager": SolanaManager { | ||
"accounts": Array [], | ||
"clusterApiUrl": "https://little-cold-butterfly.solana-devnet.quiknode.pro/c858efccfbbe7a6a291948c28193ee8d7f510594/", | ||
"connection": Connection { | ||
"_blockhashInfo": Object { | ||
"lastFetch": 0, | ||
"latestBlockhash": null, | ||
"simulatedSignatures": Array [], | ||
"transactionSignatures": Array [], | ||
}, | ||
"_commitment": "confirmed", | ||
"_confirmTransactionInitialTimeout": undefined, | ||
"_disableBlockhashCaching": false, | ||
"_nextClientSubscriptionId": 0, | ||
"_pollingBlockhash": false, | ||
"_rpcBatchRequest": [Function], | ||
"_rpcClient": ClientBrowser { | ||
"callServer": [Function], | ||
"options": Object { | ||
"generator": [Function], | ||
"notificationIdNull": false, | ||
"replacer": null, | ||
"reviver": null, | ||
"version": 2, | ||
}, | ||
}, | ||
"_rpcEndpoint": "https://little-cold-butterfly.solana-devnet.quiknode.pro/c858efccfbbe7a6a291948c28193ee8d7f510594/", | ||
"_rpcRequest": [Function], | ||
"_rpcWebSocket": Client { | ||
"_events": Object { | ||
"accountNotification": EE { | ||
"context": [Circular], | ||
"fn": [Function], | ||
"once": false, | ||
}, | ||
"close": EE { | ||
"context": [Circular], | ||
"fn": [Function], | ||
"once": false, | ||
}, | ||
"error": EE { | ||
"context": [Circular], | ||
"fn": [Function], | ||
"once": false, | ||
}, | ||
"logsNotification": EE { | ||
"context": [Circular], | ||
"fn": [Function], | ||
"once": false, | ||
}, | ||
"open": EE { | ||
"context": [Circular], | ||
"fn": [Function], | ||
"once": false, | ||
}, | ||
"programNotification": EE { | ||
"context": [Circular], | ||
"fn": [Function], | ||
"once": false, | ||
}, | ||
"rootNotification": EE { | ||
"context": [Circular], | ||
"fn": [Function], | ||
"once": false, | ||
}, | ||
"signatureNotification": EE { | ||
"context": [Circular], | ||
"fn": [Function], | ||
"once": false, | ||
}, | ||
"slotNotification": EE { | ||
"context": [Circular], | ||
"fn": [Function], | ||
"once": false, | ||
}, | ||
"slotsUpdatesNotification": EE { | ||
"context": [Circular], | ||
"fn": [Function], | ||
"once": false, | ||
}, | ||
}, | ||
"_eventsCount": 10, | ||
"address": "wss://little-cold-butterfly.solana-devnet.quiknode.pro/c858efccfbbe7a6a291948c28193ee8d7f510594/", | ||
"autoconnect": false, | ||
"current_reconnects": 0, | ||
"generate_request_id": [Function], | ||
"max_reconnects": Infinity, | ||
"queue": Object {}, | ||
"ready": false, | ||
"reconnect": true, | ||
"reconnect_interval": 1000, | ||
"rest_options": Object {}, | ||
"rpc_id": 0, | ||
"webSocketFactory": [Function], | ||
}, | ||
"_rpcWebSocketConnected": false, | ||
"_rpcWebSocketGeneration": 0, | ||
"_rpcWebSocketHeartbeat": null, | ||
"_rpcWebSocketIdleTimeout": null, | ||
"_rpcWsEndpoint": "wss://little-cold-butterfly.solana-devnet.quiknode.pro/c858efccfbbe7a6a291948c28193ee8d7f510594/", | ||
"_subscriptionCallbacksByServerSubscriptionId": Object {}, | ||
"_subscriptionDisposeFunctionsByClientSubscriptionId": Object {}, | ||
"_subscriptionsAutoDisposedByRpc": Set {}, | ||
"_subscriptionsByHash": Object {}, | ||
}, | ||
"networkIdentifier": "devnet", | ||
"publicKeys": Object {}, | ||
}, | ||
"usersProgram": null, | ||
}, | ||
} | ||
`; |
68 changes: 68 additions & 0 deletions
68
libraries/BlockchainClient/adapters/EthereumAdapter/EthereumAdapter.test.ts
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,68 @@ | ||
import * as EthereumAdapter from '~/libraries/BlockchainClient/adapters/EthereumAdapter/EthereumAdapter' | ||
describe('EthereumAdapter.default.acceptFriendRequest', () => { | ||
let inst: any | ||
|
||
beforeEach(() => { | ||
inst = new EthereumAdapter.default() | ||
}) | ||
|
||
test('0', () => { | ||
const param1: any = [ | ||
[false, true, false, false], | ||
[false, true, false, false], | ||
[true, false, true, true], | ||
[false, true, true, false], | ||
] | ||
const result: any = inst.acceptFriendRequest(param1) | ||
expect(result).toMatchSnapshot() | ||
}) | ||
|
||
test('1', () => { | ||
const param1: any = [ | ||
[false, false, true, false], | ||
[false, false, false, false], | ||
[true, true, true, false], | ||
[true, false, false, false], | ||
] | ||
const result: any = inst.acceptFriendRequest(param1) | ||
expect(result).toMatchSnapshot() | ||
}) | ||
|
||
test('2', () => { | ||
const param1: any = [ | ||
[false, true, false, true], | ||
[true, false, false, false], | ||
[false, true, false, false], | ||
[false, false, false, true], | ||
] | ||
const result: any = inst.acceptFriendRequest(param1) | ||
expect(result).toMatchSnapshot() | ||
}) | ||
|
||
test('3', () => { | ||
const param1: any = [ | ||
[true, true, false, false], | ||
[false, true, false, true], | ||
[false, false, false, false], | ||
[true, true, true, false], | ||
] | ||
const result: any = inst.acceptFriendRequest(param1) | ||
expect(result).toMatchSnapshot() | ||
}) | ||
|
||
test('4', () => { | ||
const param1: any = [ | ||
[true, true, false, false], | ||
[false, true, false, true], | ||
[false, true, false, false], | ||
[true, true, false, true], | ||
] | ||
const result: any = inst.acceptFriendRequest(param1) | ||
expect(result).toMatchSnapshot() | ||
}) | ||
|
||
test('5', () => { | ||
const result: any = inst.acceptFriendRequest([]) | ||
expect(result).toMatchSnapshot() | ||
}) | ||
}) |
13 changes: 13 additions & 0 deletions
13
...ries/BlockchainClient/adapters/EthereumAdapter/__snapshots__/EthereumAdapter.test.ts.snap
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,13 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`EthereumAdapter.default.acceptFriendRequest 0 1`] = `Promise {}`; | ||
|
||
exports[`EthereumAdapter.default.acceptFriendRequest 1 1`] = `Promise {}`; | ||
|
||
exports[`EthereumAdapter.default.acceptFriendRequest 2 1`] = `Promise {}`; | ||
|
||
exports[`EthereumAdapter.default.acceptFriendRequest 3 1`] = `Promise {}`; | ||
|
||
exports[`EthereumAdapter.default.acceptFriendRequest 4 1`] = `Promise {}`; | ||
|
||
exports[`EthereumAdapter.default.acceptFriendRequest 5 1`] = `Promise {}`; |