Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 91 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {
getStructEncoder,
getU32Decoder,
getU32Encoder,
getU64Decoder,
getU64Encoder,
getUtf8Decoder,
getUtf8Encoder,
transformEncoder,
Expand Down Expand Up @@ -98,7 +100,7 @@ export function getAuthorizeCheckedWithSeedInstructionDataEncoder(): Encoder<Aut
getStructEncoder([
['discriminator', getU32Encoder()],
['stakeAuthorize', getStakeAuthorizeEncoder()],
['authoritySeed', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
['authoritySeed', addEncoderSizePrefix(getUtf8Encoder(), getU64Encoder())],
['authorityOwner', getAddressEncoder()],
]),
value => ({ ...value, discriminator: AUTHORIZE_CHECKED_WITH_SEED_DISCRIMINATOR }),
Expand All @@ -109,7 +111,7 @@ export function getAuthorizeCheckedWithSeedInstructionDataDecoder(): Decoder<Aut
return getStructDecoder([
['discriminator', getU32Decoder()],
['stakeAuthorize', getStakeAuthorizeDecoder()],
['authoritySeed', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
['authoritySeed', addDecoderSizePrefix(getUtf8Decoder(), getU64Decoder())],
['authorityOwner', getAddressDecoder()],
]);
}
Expand Down
6 changes: 4 additions & 2 deletions clients/js/src/generated/instructions/authorizeWithSeed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import {
getStructEncoder,
getU32Decoder,
getU32Encoder,
getU64Decoder,
getU64Encoder,
getUtf8Decoder,
getUtf8Encoder,
transformEncoder,
Expand Down Expand Up @@ -97,7 +99,7 @@ export function getAuthorizeWithSeedInstructionDataEncoder(): Encoder<AuthorizeW
['discriminator', getU32Encoder()],
['newAuthorizedPubkey', getAddressEncoder()],
['stakeAuthorize', getStakeAuthorizeEncoder()],
['authoritySeed', addEncoderSizePrefix(getUtf8Encoder(), getU32Encoder())],
['authoritySeed', addEncoderSizePrefix(getUtf8Encoder(), getU64Encoder())],
['authorityOwner', getAddressEncoder()],
]),
value => ({ ...value, discriminator: AUTHORIZE_WITH_SEED_DISCRIMINATOR }),
Expand All @@ -109,7 +111,7 @@ export function getAuthorizeWithSeedInstructionDataDecoder(): Decoder<AuthorizeW
['discriminator', getU32Decoder()],
['newAuthorizedPubkey', getAddressDecoder()],
['stakeAuthorize', getStakeAuthorizeDecoder()],
['authoritySeed', addDecoderSizePrefix(getUtf8Decoder(), getU32Decoder())],
['authoritySeed', addDecoderSizePrefix(getUtf8Decoder(), getU64Decoder())],
['authorityOwner', getAddressDecoder()],
]);
}
Expand Down
6 changes: 4 additions & 2 deletions clients/js/src/generated/types/stakeAuthorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
combineCodec,
getEnumDecoder,
getEnumEncoder,
getU32Decoder,
getU32Encoder,
type FixedSizeCodec,
type FixedSizeDecoder,
type FixedSizeEncoder,
Expand All @@ -23,11 +25,11 @@ export enum StakeAuthorize {
export type StakeAuthorizeArgs = StakeAuthorize;

export function getStakeAuthorizeEncoder(): FixedSizeEncoder<StakeAuthorizeArgs> {
return getEnumEncoder(StakeAuthorize);
return getEnumEncoder(StakeAuthorize, { size: getU32Encoder() });
}

export function getStakeAuthorizeDecoder(): FixedSizeDecoder<StakeAuthorize> {
return getEnumDecoder(StakeAuthorize);
return getEnumDecoder(StakeAuthorize, { size: getU32Decoder() });
}

export function getStakeAuthorizeCodec(): FixedSizeCodec<StakeAuthorizeArgs, StakeAuthorize> {
Expand Down
3 changes: 2 additions & 1 deletion clients/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ readme = "README.md"
license-file = "../../LICENSE"

[features]
serde = ["dep:serde", "dep:serde_with"]
serde = ["dep:serde", "dep:serde_with", "kaigan/serde"]

[dependencies]
borsh = { version = "1.6", features = ["derive"] }
kaigan = { version = "0.5.0", features = ["borsh-v1"] }
num-derive = "0.4"
num-traits = "0.2"
serde = { version = "1.0", features = ["derive"], optional = true }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use {
crate::generated::types::StakeAuthorize,
borsh::{BorshDeserialize, BorshSerialize},
kaigan::types::U64PrefixString,
solana_pubkey::Pubkey,
};

Expand Down Expand Up @@ -102,7 +103,7 @@ impl Default for AuthorizeCheckedWithSeedInstructionData {
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct AuthorizeCheckedWithSeedInstructionArgs {
pub stake_authorize: StakeAuthorize,
pub authority_seed: String,
pub authority_seed: U64PrefixString,
pub authority_owner: Pubkey,
}

Expand All @@ -129,7 +130,7 @@ pub struct AuthorizeCheckedWithSeedBuilder {
new_authority: Option<solana_pubkey::Pubkey>,
lockup_authority: Option<solana_pubkey::Pubkey>,
stake_authorize: Option<StakeAuthorize>,
authority_seed: Option<String>,
authority_seed: Option<U64PrefixString>,
authority_owner: Option<Pubkey>,
__remaining_accounts: Vec<solana_instruction::AccountMeta>,
}
Expand Down Expand Up @@ -179,7 +180,7 @@ impl AuthorizeCheckedWithSeedBuilder {
self
}
#[inline(always)]
pub fn authority_seed(&mut self, authority_seed: String) -> &mut Self {
pub fn authority_seed(&mut self, authority_seed: U64PrefixString) -> &mut Self {
self.authority_seed = Some(authority_seed);
self
}
Expand Down Expand Up @@ -439,7 +440,7 @@ impl<'a, 'b> AuthorizeCheckedWithSeedCpiBuilder<'a, 'b> {
self
}
#[inline(always)]
pub fn authority_seed(&mut self, authority_seed: String) -> &mut Self {
pub fn authority_seed(&mut self, authority_seed: U64PrefixString) -> &mut Self {
self.instruction.authority_seed = Some(authority_seed);
self
}
Expand Down Expand Up @@ -535,7 +536,7 @@ struct AuthorizeCheckedWithSeedCpiBuilderInstruction<'a, 'b> {
new_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
lockup_authority: Option<&'b solana_account_info::AccountInfo<'a>>,
stake_authorize: Option<StakeAuthorize>,
authority_seed: Option<String>,
authority_seed: Option<U64PrefixString>,
authority_owner: Option<Pubkey>,
/// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
__remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
Expand Down
Loading
Loading