Skip to content

Commit ce49cc8

Browse files
authored
Fixed errors in template due to changes in repo (#283)
* Fixed errors in template due to changes in repo * added ensure_eq * Added to changelog
1 parent 4c56dc8 commit ce49cc8

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Fixed errors in cli template caused due to breaking changes made in star_frame (#283)
13+
1014
## [0.26.2] - 2025-10-15
1115

1216
### Fixed

star_frame_cli/src/template/lib_rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use star_frame::prelude::*;
2-
32
use instructions::*;
43
mod instructions;
54
pub mod states;

star_frame_cli/src/template/states_rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use star_frame::{eyre::ensure, prelude::*};
1+
use star_frame::prelude::*;
22
use crate::{name_pascalcase}Error;
33

44
#[derive(Debug, GetSeeds, Clone)]
@@ -17,13 +17,9 @@ pub struct CounterAccount {
1717

1818
pub struct Authority(pub Pubkey);
1919

20-
impl AccountValidate<Authority> for CounterAccount {
21-
fn validate_account(self_ref: &Self::Ref<'_>, arg: Authority) -> Result<()> {
22-
ensure!(
23-
arg.0 == self_ref.authority,
24-
"Incorrect authority",
25-
{name_pascalcase}Error::IncorrectAuthority
26-
);
20+
impl AccountValidate<&Pubkey> for CounterAccount {
21+
fn validate_account(self_ref: &Self::Ref<'_>, signer: &Pubkey) -> Result<()> {
22+
ensure_eq!(&self_ref.authority, signer, {name_pascalcase}Error::IncorrectAuthority);
2723
Ok(())
2824
}
2925
}

0 commit comments

Comments
 (0)