Skip to content

Migrate script/ JS files to TS - #184

Merged
gfournierPro merged 18 commits into
developfrom
feature/update-script-js-files
Feb 11, 2025
Merged

Migrate script/ JS files to TS #184
gfournierPro merged 18 commits into
developfrom
feature/update-script-js-files

Conversation

@gfournierPro

Copy link
Copy Markdown
Contributor

Files Migrated

  • getFunctionSignatures.jsgetFunctionSignatures.ts
  • common-test-snapshot.jscommon-test-snapshot.ts
  • test-storage.jstest-storage.ts
  • timelock.jstimelock.ts

@codecov

codecov Bot commented Feb 11, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.50%. Comparing base (0b0ac0a) to head (f1ee3ea).
Report is 19 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #184   +/-   ##
========================================
  Coverage    84.50%   84.50%           
========================================
  Files           35       35           
  Lines         1084     1084           
  Branches       221      221           
========================================
  Hits           916      916           
  Misses         168      168           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment thread scripts/timelock.ts Outdated
/**
* Deploy TimelockController contract
*/
module.exports = async function () {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
module.exports = async function () {
export async function () {

why not use just export ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a commonJS syntaxe 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Comment thread scripts/timelock.ts Outdated
};

// Add deployment tags
module.exports.tags = ['TimelockController'];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Comment thread migrations/utils/getFunctionSignatures.ts Outdated
Comment thread scripts/test-storage.ts Outdated
Comment thread scripts/test-storage.ts
Comment thread scripts/test-storage.ts
Comment thread scripts/test-storage.ts
Comment thread scripts/timelock.ts Outdated
Comment thread scripts/timelock.ts Outdated
Comment thread scripts/timelock.ts Outdated
Comment thread scripts/timelock.ts
Comment thread scripts/timelock.ts Outdated
Comment thread scripts/test-storage.ts
return !hasIncompatibleLayouts;
}

// Run the check if this file is being run directly

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking for that thanks

@james-toussaint james-toussaint left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job thanks 👍

const constructorArgs = [ONE_WEEK_IN_SECONDS, ADMINISTRATORS, PROPOSERS, EXECUTORS];
const timelockFactory = new TimelockController__factory(owner);

await factoryDeployer.deployWithFactory(timelockFactory, constructorArgs);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
await factoryDeployer.deployWithFactory(timelockFactory, constructorArgs);
const timelockAddress = await factoryDeployer.deployWithFactory(timelockFactory, constructorArgs);
await deployments.save('TimelockController', {
abi: TimelockController__factory.abi as unknown as ABI,
address: timelockAddress,
bytecode: TimelockController__factory.bytecode,
args: constructorArgs,
});
console.log('Timelock:', timelockAddress);

@gfournierPro
gfournierPro merged commit b22de91 into develop Feb 11, 2025
@gfournierPro
gfournierPro deleted the feature/update-script-js-files branch February 12, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants