Skip to content

Commit

Permalink
Merge pull request #192 from metaplex-foundation/fix/bad-bumping
Browse files Browse the repository at this point in the history
Merging bad bumps into mainline.
  • Loading branch information
blockiosaurus authored Sep 6, 2024
2 parents 1f86b4d + 4aa7861 commit f565600
Show file tree
Hide file tree
Showing 6 changed files with 901 additions and 54 deletions.
27 changes: 23 additions & 4 deletions clients/js/src/plugins/externalPluginAdapters.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
import { AccountMeta, Context, PublicKey } from '@metaplex-foundation/umi';
import {
AccountMeta,
Context,
isSome,
PublicKey,
} from '@metaplex-foundation/umi';
import {
lifecycleHookFromBase,
LifecycleHookInitInfoArgs,
Expand Down Expand Up @@ -59,7 +64,9 @@ import {
export type ExternalPluginAdapterTypeString =
BaseExternalPluginAdapterKey['__kind'];

export type BaseExternalPluginAdapter = BasePlugin & LifecycleChecksContainer;
export type BaseExternalPluginAdapter = BasePlugin &
ExternalPluginAdapterData &
LifecycleChecksContainer;

export type ExternalPluginAdapters =
| LifecycleHookPlugin
Expand Down Expand Up @@ -125,8 +132,8 @@ export const externalPluginAdapterManifests = {
};

export type ExternalPluginAdapterData = {
dataLen: bigint;
dataOffset: bigint;
dataLen?: bigint;
dataOffset?: bigint;
};

export function externalRegistryRecordsToExternalPluginAdapterList(
Expand Down Expand Up @@ -156,6 +163,10 @@ export function externalRegistryRecordsToExternalPluginAdapterList(
}
result.lifecycleHooks.push({
type: 'LifecycleHook',
dataOffset: isSome(record.dataOffset)
? record.dataOffset.value
: undefined,
dataLen: isSome(record.dataLen) ? record.dataLen.value : undefined,
...mappedPlugin,
...lifecycleHookFromBase(
deserializedPlugin.fields[0],
Expand All @@ -169,6 +180,10 @@ export function externalRegistryRecordsToExternalPluginAdapterList(
}
result.appDatas.push({
type: 'AppData',
dataOffset: isSome(record.dataOffset)
? record.dataOffset.value
: undefined,
dataLen: isSome(record.dataLen) ? record.dataLen.value : undefined,
...mappedPlugin,
...appDataFromBase(deserializedPlugin.fields[0], record, accountData),
});
Expand Down Expand Up @@ -214,6 +229,10 @@ export function externalRegistryRecordsToExternalPluginAdapterList(
}
result.dataSections.push({
type: 'DataSection',
dataOffset: isSome(record.dataOffset)
? record.dataOffset.value
: undefined,
dataLen: isSome(record.dataLen) ? record.dataLen.value : undefined,
...mappedPlugin,
...dataSectionFromBase(
deserializedPlugin.fields[0],
Expand Down
Loading

0 comments on commit f565600

Please sign in to comment.