Setup eslint and auto fix lint errors
This commit is contained in:
+2
-3
@@ -191,7 +191,7 @@ describe('Test laconic CLI commands', () => {
|
||||
const outputObj = checkResultAndRetrieveOutput(result);
|
||||
|
||||
// Expected account
|
||||
const expectedAccount = getAccountObj({ address: testAccount })
|
||||
const expectedAccount = getAccountObj({ address: testAccount });
|
||||
|
||||
expect(outputObj.length).toEqual(1);
|
||||
expect(outputObj[0]).toMatchObject(expectedAccount);
|
||||
@@ -213,7 +213,7 @@ describe('Test laconic CLI commands', () => {
|
||||
// Expected acconts
|
||||
const expectedAccounts = [
|
||||
getAccountObj({ address: testAccount, balance: balanceAfterSend }),
|
||||
getAccountObj({ address: testAccount2, balance: sendAmount }),
|
||||
getAccountObj({ address: testAccount2, balance: sendAmount })
|
||||
];
|
||||
|
||||
expect(outputObj.length).toEqual(2);
|
||||
@@ -282,7 +282,6 @@ describe('Test laconic CLI commands', () => {
|
||||
|
||||
expect(recordOutputObj.length).toEqual(1);
|
||||
expect(recordOutputObj[0]).toMatchObject(expectedRecord);
|
||||
|
||||
});
|
||||
|
||||
test('laconic cns bond associate --id <record_id> --bond-id <bond_id>', async () => {
|
||||
|
||||
+11
-11
@@ -12,7 +12,7 @@ export const AUCTION_FEES = {
|
||||
export const COMMIT_DURATION = 60; // 60s
|
||||
export const REVEAL_DURATION = 60; // 60s
|
||||
|
||||
export function checkResultAndRetrieveOutput(result: SpawnSyncReturns<Buffer>): any {
|
||||
export function checkResultAndRetrieveOutput (result: SpawnSyncReturns<Buffer>): any {
|
||||
expect(result.status).toBe(0);
|
||||
|
||||
const errorOutput = result.stderr.toString().trim();
|
||||
@@ -24,14 +24,14 @@ export function checkResultAndRetrieveOutput(result: SpawnSyncReturns<Buffer>):
|
||||
return JSON.parse(output);
|
||||
}
|
||||
|
||||
export function createBond(quantity: number): { bondId: string } {
|
||||
export function createBond (quantity: number): { bondId: string } {
|
||||
const result = spawnSync('laconic', ['cns', 'bond', 'create', '--type', TOKEN_TYPE, '--quantity', quantity.toString(), '--gas', '200000', '--fees', `200000${TOKEN_TYPE}`]);
|
||||
const output = result.stdout.toString().trim();
|
||||
|
||||
return JSON.parse(output);
|
||||
}
|
||||
|
||||
export function getBondObj(params: { id: string, owner: string, balance: number}): any {
|
||||
export function getBondObj (params: { id: string, owner: string, balance: number}): any {
|
||||
return {
|
||||
id: params.id,
|
||||
owner: params.owner,
|
||||
@@ -44,7 +44,7 @@ export function getBondObj(params: { id: string, owner: string, balance: number}
|
||||
};
|
||||
}
|
||||
|
||||
export function getAccountObj(params: { address: string, balance?: number }): any {
|
||||
export function getAccountObj (params: { address: string, balance?: number }): any {
|
||||
const balanceObj: any = { type: TOKEN_TYPE };
|
||||
if (params.balance) {
|
||||
balanceObj.quantity = params.balance;
|
||||
@@ -56,7 +56,7 @@ export function getAccountObj(params: { address: string, balance?: number }): an
|
||||
};
|
||||
}
|
||||
|
||||
export function getRecordObj(recordFilePath: string, params: { bondId: string, recordId: string, names: any }): any {
|
||||
export function getRecordObj (recordFilePath: string, params: { bondId: string, recordId: string, names: any }): any {
|
||||
const recordContent = yaml.load(fs.readFileSync(recordFilePath, 'utf8')) as any;
|
||||
|
||||
return {
|
||||
@@ -67,7 +67,7 @@ export function getRecordObj(recordFilePath: string, params: { bondId: string, r
|
||||
};
|
||||
}
|
||||
|
||||
export function getAuthorityObj(params: { owner: string, status: string, auction: any, bondId?: string }): any {
|
||||
export function getAuthorityObj (params: { owner: string, status: string, auction: any, bondId?: string }): any {
|
||||
return {
|
||||
ownerAddress: params.owner,
|
||||
status: params.status,
|
||||
@@ -76,7 +76,7 @@ export function getAuthorityObj(params: { owner: string, status: string, auction
|
||||
};
|
||||
}
|
||||
|
||||
export function getAuctionObj(params: { owner: string, status?: string }): any {
|
||||
export function getAuctionObj (params: { owner: string, status?: string }): any {
|
||||
return {
|
||||
status: params.status || 'commit',
|
||||
ownerAddress: params.owner,
|
||||
@@ -92,11 +92,11 @@ export function getAuctionObj(params: { owner: string, status?: string }): any {
|
||||
type: TOKEN_TYPE,
|
||||
quantity: AUCTION_FEES.minimumBid
|
||||
},
|
||||
winnerAddress: '',
|
||||
winnerAddress: ''
|
||||
};
|
||||
}
|
||||
|
||||
export function getBidObject(params: { bidder: string, status?: string }): any {
|
||||
export function getBidObject (params: { bidder: string, status?: string }): any {
|
||||
return {
|
||||
bidderAddress: params.bidder,
|
||||
status: params.status || 'commit',
|
||||
@@ -115,6 +115,6 @@ export function getBidObject(params: { bidder: string, status?: string }): any {
|
||||
};
|
||||
}
|
||||
|
||||
export async function delay(ms: number): Promise<any> {
|
||||
return new Promise(res => setTimeout(res, ms))
|
||||
export async function delay (ms: number): Promise<any> {
|
||||
return new Promise(res => setTimeout(res, ms));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user