Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add CI for integration test suite for contract upgrades #381

Open
wants to merge 81 commits into
base: main
Choose a base branch
from

Conversation

viraj124
Copy link
Contributor

@viraj124 viraj124 commented Jan 3, 2025

@DefiCake
Copy link
Member

DefiCake commented Jan 7, 2025

  • Hey, so instead of performing upgrades in the test, I thought it would be better to have the upgrade scripts which would get triggered only in the forked environment and upgrade the current mainnet contracts, before executing the tests.

I suggest to put these scripts in a separate deploy/ folder and use that folder when forking. That will make the deploy scripts easier to read and follow. The delta of changes will be reduced too.

@viraj124
Copy link
Contributor Author

viraj124 commented Jan 8, 2025

  • Hey, so instead of performing upgrades in the test, I thought it would be better to have the upgrade scripts which would get triggered only in the forked environment and upgrade the current mainnet contracts, before executing the tests.

I suggest to put these scripts in a separate deploy/ folder and use that folder when forking. That will make the deploy scripts easier to read and follow. The delta of changes will be reduced too.

will look into it

@viraj124
Copy link
Contributor Author

viraj124 commented Jan 8, 2025

  • Hey, so instead of performing upgrades in the test, I thought it would be better to have the upgrade scripts which would get triggered only in the forked environment and upgrade the current mainnet contracts, before executing the tests.

I suggest to put these scripts in a separate deploy/ folder and use that folder when forking. That will make the deploy scripts easier to read and follow. The delta of changes will be reduced too.

will look into it

this is done

@viraj124 viraj124 requested a review from DefiCake January 8, 2025 12:04
Comment on lines 59 to 87
async function getBlockWithHeight(env: any, height: string): Promise<any> {
const BLOCK_BY_HEIGHT_QUERY = `query Block($height: U64) {
block(height: $height) {
id
}
}`;
const BLOCK_BY_HEIGHT_ARGS = {
height: height,
};

return fetch(env.fuel.provider.url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
query: BLOCK_BY_HEIGHT_QUERY,
variables: BLOCK_BY_HEIGHT_ARGS,
}),
})
.then((res: any) => res.json())
.then(async (res) => {
if (!res.data.block) {
throw new Error(`Could not fetch block with height ${height}`);
}

return res.data.block;
});
}
Copy link
Member

Choose a reason for hiding this comment

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

This is typeless, why not use fuelsProvider.getBlock(height)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replaced

@viraj124 viraj124 requested a review from DefiCake January 10, 2025 12:45
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.

Implement workflow to run a test suite on a fork for contract upgrades
2 participants