Skip to content

lang: add check that declared id == program id - #1451

Merged
armaniferrante merged 7 commits into
otter-sec:masterfrom
paul-schaaf:declared-id-check
Feb 15, 2022
Merged

lang: add check that declared id == program id#1451
armaniferrante merged 7 commits into
otter-sec:masterfrom
paul-schaaf:declared-id-check

Conversation

@paul-schaaf

Copy link
Copy Markdown
Contributor

No description provided.

@paul-schaaf
paul-schaaf marked this pull request as ready for review February 15, 2022 17:17
@paul-schaaf

Copy link
Copy Markdown
Contributor Author

wasnt quite sure which category to put the error under. used miscellaneous for now

Comment thread lang/src/error.rs Outdated
// Miscellaneous
/// 50 - The declared program id does not match actual program id
#[msg("The declared program id does not match the actual program id")]
DeclaredProgramIdMismatch = 50,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Will this collide with solana_program error codes? Probably not?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

probably not but no reason to take that risk. we can move the misc errors to 4500

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

moved to 4100

Comment thread tests/declare-id/package-lock.json Outdated
@@ -0,0 +1,16 @@
{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

file to be removed

Comment thread tests/declare-id/yarn.lock Outdated
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

file to be removed

Comment thread tests/declare-id/programs/declare-id/src/lib.rs Outdated
@paul-schaaf

Copy link
Copy Markdown
Contributor Author

implemented review

@armaniferrante
armaniferrante merged commit 1f56a62 into otter-sec:master Feb 15, 2022
akash-osec pushed a commit to akash-osec/anchor that referenced this pull request Mar 25, 2026
@jamie-osec jamie-osec added this to the Pre-1.0 milestone Jun 24, 2026
akash-osec pushed a commit to akash-osec/anchor that referenced this pull request Jul 25, 2026
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