Skip to content

Commit

Permalink
pass smartaccountAPI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
freeelancer committed Mar 6, 2024
1 parent b250a37 commit 9196190
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/client/lcd/LCDClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {
IbcTransferAPI,
IbcAPI,
TokenFactory,
FeemarketAPI,
SmartaccountAPI,
} from './api';
import { LCDUtils } from './LCDUtils';
import { Wallet } from './Wallet';
Expand All @@ -27,8 +29,6 @@ import { FeeshareAPI } from './api/FeeshareAPI';
import { GovV1API } from './api/GovV1API';
import { ICAv1API } from './api/ICAv1API';
import { ICQv1API } from './api/ICQv1API';
import { FeemarketAPI } from './api/FeemarketAPI';
import { SmartaccountAPI } from './api/SmartaccountAPI';

export type AxiosConfig = {
/**
Expand Down
22 changes: 14 additions & 8 deletions src/client/lcd/api/SmartaccountAPI.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Setting } from '../../../core/smartaccount/v1/models/Setting';
import { SmartaccountParams } from '../../../core/smartaccount/v1/models/SmartaccountParams';
import { LCDClient } from '../LCDClient';
import { SmartaccountAPI } from './SmartaccountAPI';
Expand All @@ -24,12 +25,17 @@ describe('SmartaccountAPI', () => {
expect(res.toData()).toEqual({});
});

// TODO: there must be a smart account created to test this
// it('assert the account setting', async () => {
// const res = await smartaccount.setting('a');
// // TODO: call
// const setting = new Setting('a', [], [], [], true);
// expect(res).toStrictEqual(setting);
// expect(res.toData()).toEqual(setting);
// });
// test with wallet15 terra1tck9vx8vwu6l83zy76ssdkhnhw8dfcrt80hc6x
it('assert the account setting', async () => {
const res = await smartaccount.setting(
'terra1tck9vx8vwu6l83zy76ssdkhnhw8dfcrt80hc6x'
);
expect(res.toData()).toEqual({
owner: 'terra1tck9vx8vwu6l83zy76ssdkhnhw8dfcrt80hc6x',
authorization: [],
post_transaction: [],
pre_transaction: [],
fallback: true,
});
});
});
4 changes: 2 additions & 2 deletions src/client/lcd/api/SmartaccountAPI.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Setting } from 'core/smartaccount/v1/models/Setting';
import { Setting } from '../../../core/smartaccount';
import { AccAddress } from '../../../core';
import { LCDClient } from '../LCDClient';
import { BaseAPI } from './BaseAPI';
import { SmartaccountParams } from 'core/smartaccount';
import { SmartaccountParams } from '../../../core/smartaccount';

export class SmartaccountAPI extends BaseAPI {
constructor(public lcd: LCDClient) {
Expand Down
2 changes: 2 additions & 0 deletions src/client/lcd/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ export * from './MintAPI';
export * from './TokenFactoryAPI';
export * from './IbcAPI';
export * from './IbcTransferAPI';
export * from './FeemarketAPI';
export * from './SmartaccountAPI';

0 comments on commit 9196190

Please sign in to comment.