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

[Test] contract staking test contract #4976

Conversation

EdHastingsCasperAssociation
Copy link
Collaborator

This PR adds a test contract for contract staking to prevent regression.

@EdHastingsCasperAssociation EdHastingsCasperAssociation marked this pull request as ready for review November 25, 2024 13:20
if let Some(StoredValue::Unbonding(unbonding_purses)) =
tc.get(&key).map_err(Into::<ProtocolUpgradeError>::into)?
{
// prune away the original record, we don't need it anymore
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have an if condition to only migrate unbonding purses based on the unbonding delay, i.e what we did for redelegate, only migrate the purses that are yet to be paid

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe. However, the original logic was a stored value of a vec of unbonding purses which were being popped off for a pseudo prune so there shouldn't be any such records.

On that note tho, an optimization to not write the record if unbond.eras().len() == 0 would certainly be feasible.

@EdHastingsCasperAssociation
Copy link
Collaborator Author

bors r+

@@ -479,6 +479,11 @@ where
&self.runtime_footprint
}

/// Returns the addressable entity being used by this instance.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just noticed this docu comment is wrong. Should be:

"Returns a mutable reference to the runtime footprint used by this instance."

Copy link
Contributor

Build succeeded:

@casperlabs-bors-ng casperlabs-bors-ng bot merged commit 2bdfb49 into casper-network:feat-2.0 Nov 25, 2024
3 checks passed
@devendran-m
Copy link
Contributor

Related issue #4929

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.

3 participants