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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

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 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
Signed-off-by: chrismaree <[email protected]>
@@ -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?

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.

2 participants