Skip to content

Commit 47eeceb

Browse files
spl: Add static lifetime for idl-build discriminator constants (otter-sec#3129)
Co-authored-by: acheron <98934430+acheroncrypto@users.noreply.github.com>
1 parent 02dc537 commit 47eeceb

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

spl/src/governance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ macro_rules! vote_weight_record {
6060

6161
#[cfg(feature = "idl-build")]
6262
impl anchor_lang::Discriminator for VoterWeightRecord {
63-
const DISCRIMINATOR: &[u8] = &[];
63+
const DISCRIMINATOR: &'static [u8] = &[];
6464
}
6565
};
6666
}

spl/src/idl_build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ macro_rules! impl_idl_build {
1010
//
1111
// TODO: Find a better way to handle discriminators of wrapped external accounts.
1212
impl anchor_lang::Discriminator for $ty {
13-
const DISCRIMINATOR: &[u8] = &[];
13+
const DISCRIMINATOR: &'static [u8] = &[];
1414
}
1515
};
1616
}

0 commit comments

Comments
 (0)