Skip to content

Commit 021af3c

Browse files
Fix unit tests
1 parent c57f13b commit 021af3c

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

__tests__/unit/core-api/__support__/app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ export const initApp = (): Application => {
106106
app.bind(Identifiers.TransactionHandler).to(Two.HtlcLockTransactionHandler);
107107
app.bind(Identifiers.TransactionHandler).to(Two.HtlcClaimTransactionHandler);
108108
app.bind(Identifiers.TransactionHandler).to(Two.HtlcRefundTransactionHandler);
109+
app.bind(Identifiers.TransactionHandler).to(Two.BlsPublicKeyRegistrationTransactionHandler);
109110

110111
app.bind(Identifiers.TransactionHandlerProvider).to(TransactionHandlerProvider).inSingletonScope();
111112
app.bind(Identifiers.TransactionHandlerRegistry).to(TransactionHandlerRegistry).inSingletonScope();

__tests__/unit/core-api/controllers/transactions.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ describe("TransactionsController", () => {
316316
it("should return registered schemas", async () => {
317317
const response = (await controller.schemas(undefined, undefined)) as ItemResponse;
318318

319-
const coreTransactionHandlersCount = 11;
319+
const coreTransactionHandlersCount = 12;
320320
expect(Object.keys(response.data["1"]).length).toBe(coreTransactionHandlersCount);
321321
});
322322
});

__tests__/unit/core-state/wallets/wallet-repository-copy-on-write.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Contracts } from "@packages/core-kernel";
44
import { Wallet, WalletRepository, WalletRepositoryCopyOnWrite } from "@packages/core-state/src/wallets";
55
import {
66
addressesIndexer,
7+
blsPublicKeysIndexer,
78
ipfsIndexer,
89
locksIndexer,
910
publicKeysIndexer,
@@ -36,14 +37,15 @@ describe("Wallet Repository Copy On Write", () => {
3637
});
3738

3839
it("should be able to look up indexers", () => {
39-
const expected = ["addresses", "publicKeys", "usernames", "resignations", "locks", "ipfs"];
40+
const expected = ["addresses", "publicKeys", "usernames", "resignations", "locks", "ipfs", "blsPublicKeys"];
4041
expect(walletRepoCopyOnWrite.getIndexNames()).toEqual(expected);
4142
expect(walletRepoCopyOnWrite.getIndex("addresses").indexer).toEqual(addressesIndexer);
4243
expect(walletRepoCopyOnWrite.getIndex("publicKeys").indexer).toEqual(publicKeysIndexer);
4344
expect(walletRepoCopyOnWrite.getIndex("usernames").indexer).toEqual(usernamesIndexer);
4445
expect(walletRepoCopyOnWrite.getIndex("resignations").indexer).toEqual(resignationsIndexer);
4546
expect(walletRepoCopyOnWrite.getIndex("locks").indexer).toEqual(locksIndexer);
4647
expect(walletRepoCopyOnWrite.getIndex("ipfs").indexer).toEqual(ipfsIndexer);
48+
expect(walletRepoCopyOnWrite.getIndex("blsPublicKeys").indexer).toEqual(blsPublicKeysIndexer);
4749
});
4850

4951
it("should find wallets by address", () => {

__tests__/unit/core-state/wallets/wallet-repository.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
import { Wallet, WalletRepository } from "@packages/core-state/src/wallets";
1212
import {
1313
addressesIndexer,
14+
blsPublicKeysIndexer,
1415
ipfsIndexer,
1516
locksIndexer,
1617
publicKeysIndexer,
@@ -75,6 +76,7 @@ describe("Wallet Repository", () => {
7576
"resignations",
7677
"locks",
7778
"ipfs",
79+
"blsPublicKeys",
7880
"businesses",
7981
"bridgechains",
8082
];
@@ -85,6 +87,7 @@ describe("Wallet Repository", () => {
8587
expect(walletRepo.getIndex("resignations").indexer).toEqual(resignationsIndexer);
8688
expect(walletRepo.getIndex("locks").indexer).toEqual(locksIndexer);
8789
expect(walletRepo.getIndex("ipfs").indexer).toEqual(ipfsIndexer);
90+
expect(walletRepo.getIndex("blsPublicKeys").indexer).toEqual(blsPublicKeysIndexer);
8891
expect(() => walletRepo.getIndex("iDontExist")).toThrow();
8992
});
9093

packages/core-test-framework/src/app/generators/crypto.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ export class CryptoGenerator extends Generator {
127127
aip37: true,
128128
htlcEnabled: true,
129129
blockBurnAddress: true,
130+
blsPublicKeyRegistrationEnabled: true,
130131
},
131132
{
132133
height: rewardHeight,

0 commit comments

Comments
 (0)