Skip to content

Commit

Permalink
clean logs and lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Foivos committed Oct 28, 2024
1 parent 44245d6 commit 52df60e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/node/node-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ export function updateMoveToml(
moveDir: string = `${__dirname}/../../move`,
prepToml: undefined | ((moveJson: Record<string, TomlPrimitive>) => Record<string, TomlPrimitive>) = undefined,
) {
console.log(packageName, packageId, moveDir);
// Path to the Move.toml file for the package
const movePath = `${moveDir}/${packageName}/Move.toml`;

Expand All @@ -102,6 +101,7 @@ export function updateMoveToml(
if (prepToml) {
moveJson = prepToml(moveJson);
}

fs.writeFileSync(movePath, toml.stringify(moveJson));
}

Expand Down
7 changes: 1 addition & 6 deletions src/node/tx-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Bytes } from 'ethers';
import { TxBuilderBase } from '../common/tx-builder-base';
import { InterchainTokenOptions } from '../common/types';
import { getContractBuild as getMoveContractBuild, removeFile, writeInterchainToken } from './node-utils';
import { execSync } from 'child_process';

export class TxBuilder extends TxBuilderBase {
getContractBuild(
Expand All @@ -24,7 +23,6 @@ export class TxBuilder extends TxBuilderBase {
}

async publishPackage(packageName: string, moveDir: string = `${__dirname}/../../move`): Promise<TransactionResult> {
console.log(packageName, moveDir);
const { modules, dependencies } = this.getContractBuild(packageName, moveDir);

return this.tx.publish({
Expand All @@ -35,10 +33,7 @@ export class TxBuilder extends TxBuilderBase {

async publishPackageAndTransferCap(packageName: string, to: string, moveDir = `${__dirname}/../../move`) {
const cap = await this.publishPackage(packageName, moveDir);
console.log(execSync(`cat ${__dirname}/../../move_compile/${packageName}/Move.toml`, {
encoding: 'utf-8',
stdio: 'pipe',
}));

this.tx.transferObjects([cap], to);
}
}
4 changes: 2 additions & 2 deletions test/its.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe('ITS', () => {
creatorCap: findObjectId(deployments.axelar_gateway.publishTxn, 'CreatorCap'),
itsOwnerCap: findObjectId(deployments.its.publishTxn, `${deployments.its.packageId}::owner_cap::OwnerCap`),
};
// Mint some coins for tests
// Mint some coins for tests
const tokenTxBuilder = new TxBuilder(client);

await tokenTxBuilder.moveCall({
Expand Down Expand Up @@ -254,7 +254,7 @@ describe('ITS', () => {
destination_id: destinationAddress,
payload,
payload_hash: keccak256(payload),
};
};
await approveAndExecute(client, keypair, gatewayInfo, discoveryInfo, message);
});
});
Expand Down
4 changes: 2 additions & 2 deletions test/squid.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const { keccak256, defaultAbiCoder, hexlify, randomBytes } = require('ethers/lib

const SUI = '0x2';

describe.only('Squid', () => {
describe('Squid', () => {
// Sui Client
let client;
const network = process.env.NETWORK || 'localnet';
Expand Down Expand Up @@ -283,6 +283,7 @@ describe.only('Squid', () => {
type,
};
}

pools.ab = await createPool('a', 'b');
pools.bc = await createPool('b', 'c');
await fundPool('a', 'b', 1000000);
Expand All @@ -296,7 +297,6 @@ describe.only('Squid', () => {
});

it('should succesfully perform a swap', async () => {
return;
const swap = bcsStructs.squid.DeepbookV3SwapData.serialize({
swap_type: { DeepbookV3: null },
pool_id: pools.ab,
Expand Down
1 change: 0 additions & 1 deletion test/testutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ async function publishExternalPackage(client, keypair, packageName, packageDir,
const publishTxn = await builder.signAndExecute(keypair, options);

const packageId = (publishTxn.objectChanges?.find((a) => a.type === 'published') ?? []).packageId;
console.log(packageId);
updateMoveToml(packageName, packageId, compileDir);
return { packageId, publishTxn };
}
Expand Down

0 comments on commit 52df60e

Please sign in to comment.