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

fix: better seed usage and improve signer macro location #691

Merged
merged 9 commits into from
Oct 28, 2024

Conversation

chrismaree
Copy link
Member

@chrismaree chrismaree commented Oct 25, 2024

stylistic and formatting improvement

Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
Signed-off-by: chrismaree <[email protected]>
@chrismaree chrismaree marked this pull request as draft October 25, 2024 12:54
@chrismaree chrismaree force-pushed the chrismaree/seed-improvement branch from c04acc4 to 249bf4c Compare October 25, 2024 12:58
@chrismaree chrismaree force-pushed the chrismaree/seed-improvement branch from 8ca2d38 to 10e0eef Compare October 25, 2024 13:00
@chrismaree chrismaree changed the title fix: better seed safte and sigher macro location fix: better seed usage and improve signer macro location Oct 25, 2024
@chrismaree chrismaree marked this pull request as ready for review October 25, 2024 14:31
@@ -45,6 +45,13 @@ pub fn initialize(
let state = &mut ctx.accounts.state;
state.owner = *ctx.accounts.signer.key;
state.seed = seed; // Set the seed in the state

// Seed should only be used in tests to enable fresh state between deployments. In production always set to 0.
#[cfg(not(feature = "test"))]
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe move it out to testable, similar how we call initialize_current_time below?

@chrismaree chrismaree force-pushed the chrismaree/seed-improvement branch from dc49436 to 78eb22a Compare October 28, 2024 09:42
@chrismaree chrismaree merged commit 0e09d55 into master Oct 28, 2024
9 checks passed
@chrismaree chrismaree deleted the chrismaree/seed-improvement branch October 28, 2024 10:59
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