Skip to content

Commit

Permalink
updated tests & verifiers fix
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Shorsher <[email protected]>
  • Loading branch information
shorsher committed Aug 25, 2022
1 parent d940ce5 commit ff49eb2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion server/src/controllers/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class CommonController {
async verifiers(): Promise<Verifier[]> {
try {
const orgs = await firefly.getOrganizations();
let verifiers = await firefly.getVerifiers('ff_system');
let verifiers = await firefly.getVerifiers('default');
if (verifiers.length === 0) {
// attempt to query legacy ff_system verifiers
verifiers = await firefly.getVerifiers('ff_system');
Expand Down
4 changes: 0 additions & 4 deletions server/test/common.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ describe('Common Operations', () => {

mockFireFly.getOrganizations.mockResolvedValueOnce(orgs);
mockFireFly.getVerifiers.mockResolvedValueOnce(verifiers);
mockFireFly.getVerifiers.mockResolvedValueOnce([]);

await request(server)
.get('/api/common/verifiers')
Expand All @@ -71,8 +70,5 @@ describe('Common Operations', () => {

expect(mockFireFly.getOrganizations).toHaveBeenCalledWith();
expect(mockFireFly.getVerifiers).toHaveBeenCalledWith('default');

expect(mockFireFly.getOrganizations).toHaveBeenCalledWith();
expect(mockFireFly.getVerifiers).toHaveBeenCalledWith('ff_system');
});
});
4 changes: 4 additions & 0 deletions server/test/contracts.template.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ describe('Templates: Smart Contracts', () => {
topic: 'app1',
apiName: 'api1',
eventPath: 'set',
firstEvent: 'newest',
}),
).toBe(
formatTemplate(`
Expand All @@ -135,6 +136,9 @@ describe('Templates: Smart Contracts', () => {
'set',
{
topic: 'app1',
options: {
firstEvent: 'newest',
}
},
);
return {
Expand Down
4 changes: 4 additions & 0 deletions server/test/contracts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ describe('Smart Contracts', () => {
apiName: 'my-api',
eventPath: 'Changed',
topic: 'my-app',
firstEvent: 'newest'
};
const listener = {
id: 'listener1',
Expand All @@ -245,6 +246,9 @@ describe('Smart Contracts', () => {

expect(mockFireFly.createContractAPIListener).toHaveBeenCalledWith('my-api', 'Changed', {
topic: 'my-app',
options: {
firstEvent: 'newest',
},
});
});
});
2 changes: 2 additions & 0 deletions server/test/tokens.template.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ describe('Templates: Tokens', () => {
symbol: 'P1',
type: 'fungible',
address: undefined,
blockNumber: '0',
}),
).toBe(
formatTemplate(`
Expand All @@ -24,6 +25,7 @@ describe('Templates: Tokens', () => {
symbol: 'P1',
type: 'fungible',
config: {
blockNumber: '0',
}
});
return { type: 'token_pool', id: pool.id };
Expand Down

0 comments on commit ff49eb2

Please sign in to comment.