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

Staking contract E2E test setup #492

Merged
merged 29 commits into from
Aug 20, 2024
Merged

Staking contract E2E test setup #492

merged 29 commits into from
Aug 20, 2024

Conversation

cam-schultz
Copy link
Contributor

@cam-schultz cam-schultz commented Aug 15, 2024

Why this should be merged

Fixes #433
Fixes #434
Fixes #470
Fixes #493

Supercedes #479

Demonstrates how to write E2E tests for the staking contracts

How this works

How this was tested

Added E2E test for registering and delisting a validator. Additional E2E tests to follow.

How is this documented

N/A

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No changes of substance in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No changes of substance in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No changes of substance in this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No changes of substance in this file.

@cam-schultz cam-schultz marked this pull request as ready for review August 15, 2024 20:37
@cam-schultz cam-schultz requested a review from a team as a code owner August 15, 2024 20:37
Copy link
Contributor

@bernard-avalabs bernard-avalabs left a comment

Choose a reason for hiding this comment

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

Generally makes sense to me. Left a comment about how we pack a message.

contracts/staking/StakingMessages.sol Show resolved Hide resolved
// the P-Chain will reject the registration, and the stake can be returned to the staker after the registration
// expiry has passed.
require(signature.length == 64, "StakingManager: Invalid signature length");
require(blsPublicKey.length == 48, "StakingManager: Invalid blsPublicKey length");

Choose a reason for hiding this comment

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

can have a constant for the length

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since these packing/unpacking methods are likely to be refactored/optimized significantly in the future, I'm going to hold off on making further changes for now. Also pointing out that there were no length constants in the previous implementation.

tests/flows/erc20_token_staking.go Outdated Show resolved Hide resolved
tests/flows/erc20_token_staking.go Outdated Show resolved Hide resolved
tests/flows/erc20_token_staking.go Outdated Show resolved Hide resolved
tests/utils/erc20_utils.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants