Skip to content

Commit

Permalink
Regenerate IDL and clients
Browse files Browse the repository at this point in the history
  • Loading branch information
danenbm committed Feb 22, 2024
1 parent 9f6d2d2 commit 3c293eb
Show file tree
Hide file tree
Showing 8 changed files with 66 additions and 190 deletions.
143 changes: 0 additions & 143 deletions clients/js/src/generated/accounts/hashedAssetSchema.ts

This file was deleted.

1 change: 0 additions & 1 deletion clients/js/src/generated/accounts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,5 @@

export * from './asset';
export * from './hashedAsset';
export * from './hashedAssetSchema';
export * from './pluginHeader';
export * from './pluginRegistry';
38 changes: 38 additions & 0 deletions clients/js/src/generated/types/hashedAssetSchema.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/**
* 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';
import { PluginHash, PluginHashArgs, getPluginHashSerializer } from '.';

export type HashedAssetSchema = {
assetHash: Uint8Array;
pluginHashes: Array<PluginHash>;
};

export type HashedAssetSchemaArgs = {
assetHash: Uint8Array;
pluginHashes: Array<PluginHashArgs>;
};

export function getHashedAssetSchemaSerializer(): Serializer<
HashedAssetSchemaArgs,
HashedAssetSchema
> {
return struct<HashedAssetSchema>(
[
['assetHash', bytes({ size: 32 })],
['pluginHashes', array(getPluginHashSerializer())],
],
{ description: 'HashedAssetSchema' }
) as Serializer<HashedAssetSchemaArgs, HashedAssetSchema>;
}
1 change: 1 addition & 0 deletions clients/js/src/generated/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export * from './dataState';
export * from './externalPluginRecord';
export * from './extraAccounts';
export * from './freeze';
export * from './hashedAssetSchema';
export * from './key';
export * from './migrationLevel';
export * from './plugin';
Expand Down
2 changes: 0 additions & 2 deletions clients/rust/src/generated/accounts/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@
pub(crate) mod asset;
pub(crate) mod hashed_asset;
pub(crate) mod hashed_asset_schema;
pub(crate) mod plugin_header;
pub(crate) mod plugin_registry;

pub use self::asset::*;
pub use self::hashed_asset::*;
pub use self::hashed_asset_schema::*;
pub use self::plugin_header::*;
pub use self::plugin_registry::*;
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,3 @@ pub struct HashedAssetSchema {
pub asset_hash: [u8; 32],
pub plugin_hashes: Vec<PluginHash>,
}

impl HashedAssetSchema {
#[inline(always)]
pub fn from_bytes(data: &[u8]) -> Result<Self, std::io::Error> {
let mut data = data;
Self::deserialize(&mut data)
}
}

impl<'a> TryFrom<&solana_program::account_info::AccountInfo<'a>> for HashedAssetSchema {
type Error = std::io::Error;

fn try_from(
account_info: &solana_program::account_info::AccountInfo<'a>,
) -> Result<Self, Self::Error> {
let mut data: &[u8] = &(*account_info.data).borrow();
Self::deserialize(&mut data)
}
}
2 changes: 2 additions & 0 deletions clients/rust/src/generated/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub(crate) mod data_state;
pub(crate) mod external_plugin_record;
pub(crate) mod extra_accounts;
pub(crate) mod freeze;
pub(crate) mod hashed_asset_schema;
pub(crate) mod key;
pub(crate) mod migration_level;
pub(crate) mod plugin;
Expand All @@ -34,6 +35,7 @@ pub use self::data_state::*;
pub use self::external_plugin_record::*;
pub use self::extra_accounts::*;
pub use self::freeze::*;
pub use self::hashed_asset_schema::*;
pub use self::key::*;
pub use self::migration_level::*;
pub use self::plugin::*;
Expand Down
50 changes: 25 additions & 25 deletions idls/mpl_asset_program.json
Original file line number Diff line number Diff line change
Expand Up @@ -835,31 +835,6 @@
}
]
}
},
{
"name": "HashedAssetSchema",
"type": {
"kind": "struct",
"fields": [
{
"name": "assetHash",
"type": {
"array": [
"u8",
32
]
}
},
{
"name": "pluginHashes",
"type": {
"vec": {
"defined": "PluginHash"
}
}
}
]
}
}
],
"types": [
Expand Down Expand Up @@ -1233,6 +1208,31 @@
]
}
},
{
"name": "HashedAssetSchema",
"type": {
"kind": "struct",
"fields": [
{
"name": "assetHash",
"type": {
"array": [
"u8",
32
]
}
},
{
"name": "pluginHashes",
"type": {
"vec": {
"defined": "PluginHash"
}
}
}
]
}
},
{
"name": "Plugin",
"type": {
Expand Down

0 comments on commit 3c293eb

Please sign in to comment.