Skip to content

Commit

Permalink
Update autogenerated code
Browse files Browse the repository at this point in the history
  • Loading branch information
febo committed Dec 27, 2023
1 parent bb8d137 commit 6b311a1
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 52 deletions.
2 changes: 1 addition & 1 deletion clients/js/src/generated/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export * from './dataV2';
export * from './delegateArgs';
export * from './escrowAuthority';
export * from './key';
export * from './leafInfo';
export * from './lockArgs';
export * from './metadataDelegateRole';
export * from './migrationType';
Expand All @@ -32,6 +31,7 @@ export * from './payloadType';
export * from './printArgs';
export * from './printSupply';
export * from './programmableConfig';
export * from './proofInfo';
export * from './reservation';
export * from './reservationV1';
export * from './revokeArgs';
Expand Down
28 changes: 0 additions & 28 deletions clients/js/src/generated/types/leafInfo.ts

This file was deleted.

12 changes: 6 additions & 6 deletions clients/js/src/generated/types/payloadType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,24 +18,24 @@ import {
u64,
} from '@metaplex-foundation/umi/serializers';
import {
LeafInfo,
LeafInfoArgs,
ProofInfo,
ProofInfoArgs,
SeedsVec,
SeedsVecArgs,
getLeafInfoSerializer,
getProofInfoSerializer,
getSeedsVecSerializer,
} from '.';

export type PayloadType =
| { __kind: 'Pubkey'; fields: [PublicKey] }
| { __kind: 'Seeds'; fields: [SeedsVec] }
| { __kind: 'MerkleProof'; fields: [LeafInfo] }
| { __kind: 'MerkleProof'; fields: [ProofInfo] }
| { __kind: 'Number'; fields: [bigint] };

export type PayloadTypeArgs =
| { __kind: 'Pubkey'; fields: [PublicKey] }
| { __kind: 'Seeds'; fields: [SeedsVecArgs] }
| { __kind: 'MerkleProof'; fields: [LeafInfoArgs] }
| { __kind: 'MerkleProof'; fields: [ProofInfoArgs] }
| { __kind: 'Number'; fields: [number | bigint] };

export function getPayloadTypeSerializer(): Serializer<
Expand All @@ -59,7 +59,7 @@ export function getPayloadTypeSerializer(): Serializer<
[
'MerkleProof',
struct<GetDataEnumKindContent<PayloadType, 'MerkleProof'>>([
['fields', tuple([getLeafInfoSerializer()])],
['fields', tuple([getProofInfoSerializer()])],
]),
],
[
Expand Down
24 changes: 24 additions & 0 deletions clients/js/src/generated/types/proofInfo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* This code was AUTOGENERATED using the kinobi library.
* Please DO NOT EDIT THIS FILE, instead use visitors
* to add features, then rerun kinobi to update it.
*
* @see https://github.com/metaplex-foundation/kinobi
*/

import {
Serializer,
array,
bytes,
struct,
} from '@metaplex-foundation/umi/serializers';

export type ProofInfo = { proof: Array<Uint8Array> };

export type ProofInfoArgs = ProofInfo;

export function getProofInfoSerializer(): Serializer<ProofInfoArgs, ProofInfo> {
return struct<ProofInfo>([['proof', array(bytes({ size: 32 }))]], {
description: 'ProofInfo',
}) as Serializer<ProofInfoArgs, ProofInfo>;
}
4 changes: 2 additions & 2 deletions clients/rust/src/generated/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ pub(crate) mod data_v2;
pub(crate) mod delegate_args;
pub(crate) mod escrow_authority;
pub(crate) mod key;
pub(crate) mod leaf_info;
pub(crate) mod lock_args;
pub(crate) mod metadata_delegate_role;
pub(crate) mod migration_type;
Expand All @@ -31,6 +30,7 @@ pub(crate) mod payload_type;
pub(crate) mod print_args;
pub(crate) mod print_supply;
pub(crate) mod programmable_config;
pub(crate) mod proof_info;
pub(crate) mod reservation;
pub(crate) mod reservation_v1;
pub(crate) mod revoke_args;
Expand Down Expand Up @@ -63,7 +63,6 @@ pub use self::data_v2::*;
pub use self::delegate_args::*;
pub use self::escrow_authority::*;
pub use self::key::*;
pub use self::leaf_info::*;
pub use self::lock_args::*;
pub use self::metadata_delegate_role::*;
pub use self::migration_type::*;
Expand All @@ -75,6 +74,7 @@ pub use self::payload_type::*;
pub use self::print_args::*;
pub use self::print_supply::*;
pub use self::programmable_config::*;
pub use self::proof_info::*;
pub use self::reservation::*;
pub use self::reservation_v1::*;
pub use self::revoke_args::*;
Expand Down
4 changes: 2 additions & 2 deletions clients/rust/src/generated/types/payload_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//! [https://github.com/metaplex-foundation/kinobi]
//!
use crate::generated::types::LeafInfo;
use crate::generated::types::ProofInfo;
use crate::generated::types::SeedsVec;
use borsh::BorshDeserialize;
use borsh::BorshSerialize;
Expand All @@ -16,6 +16,6 @@ use solana_program::pubkey::Pubkey;
pub enum PayloadType {
Pubkey(Pubkey),
Seeds(SeedsVec),
MerkleProof(LeafInfo),
MerkleProof(ProofInfo),
Number(u64),
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use borsh::BorshSerialize;

#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct LeafInfo {
pub leaf: [u8; 32],
pub struct ProofInfo {
pub proof: Vec<[u8; 32]>,
}
13 changes: 2 additions & 11 deletions idls/token_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5508,19 +5508,10 @@
}
},
{
"name": "LeafInfo",
"name": "ProofInfo",
"type": {
"kind": "struct",
"fields": [
{
"name": "leaf",
"type": {
"array": [
"u8",
32
]
}
},
{
"name": "proof",
"type": {
Expand Down Expand Up @@ -6727,7 +6718,7 @@
"name": "MerkleProof",
"fields": [
{
"defined": "LeafInfo"
"defined": "ProofInfo"
}
]
},
Expand Down

0 comments on commit 6b311a1

Please sign in to comment.