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
12 changes: 6 additions & 6 deletions clients/js/src/generated/errors/mplCore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,18 +726,18 @@ export class InvalidExecutePdaError extends ProgramError {
codeToErrorMap.set(0x31, InvalidExecutePdaError);
nameToErrorMap.set('InvalidExecutePda', InvalidExecutePdaError);

/** BlockedByBubblegumV1: Bubblegum V1 Plugin limits other plugins */
export class BlockedByBubblegumV1Error extends ProgramError {
override readonly name: string = 'BlockedByBubblegumV1';
/** BlockedByBubblegumV2: Bubblegum V2 Plugin limits other plugins */
export class BlockedByBubblegumV2Error extends ProgramError {
override readonly name: string = 'BlockedByBubblegumV2';

readonly code: number = 0x32; // 50

constructor(program: Program, cause?: Error) {
super('Bubblegum V1 Plugin limits other plugins', program, cause);
super('Bubblegum V2 Plugin limits other plugins', program, cause);
}
}
codeToErrorMap.set(0x32, BlockedByBubblegumV1Error);
nameToErrorMap.set('BlockedByBubblegumV1', BlockedByBubblegumV1Error);
codeToErrorMap.set(0x32, BlockedByBubblegumV2Error);
nameToErrorMap.set('BlockedByBubblegumV2', BlockedByBubblegumV2Error);

/**
* Attempts to resolve a custom program error from the provided error code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@

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

export type BubblegumV1 = {};
export type BubblegumV2 = {};

export type BubblegumV1Args = BubblegumV1;
export type BubblegumV2Args = BubblegumV2;

export function getBubblegumV1Serializer(): Serializer<
BubblegumV1Args,
BubblegumV1
export function getBubblegumV2Serializer(): Serializer<
BubblegumV2Args,
BubblegumV2
> {
return struct<BubblegumV1>([], { description: 'BubblegumV1' }) as Serializer<
BubblegumV1Args,
BubblegumV1
return struct<BubblegumV2>([], { description: 'BubblegumV2' }) as Serializer<
BubblegumV2Args,
BubblegumV2
>;
}
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 @@ -41,7 +41,7 @@ export * from './baseRuleSet';
export * from './baseSeed';
export * from './baseUpdateAuthority';
export * from './baseValidationResultsOffset';
export * from './bubblegumV1';
export * from './bubblegumV2';
export * from './burnDelegate';
export * from './compressionProof';
export * from './creator';
Expand Down
22 changes: 11 additions & 11 deletions clients/js/src/generated/types/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import {
BaseMasterEditionArgs,
BaseRoyalties,
BaseRoyaltiesArgs,
BubblegumV1,
BubblegumV1Args,
BubblegumV2,
BubblegumV2Args,
BurnDelegate,
BurnDelegateArgs,
Edition,
Expand All @@ -52,7 +52,7 @@ import {
getAutographSerializer,
getBaseMasterEditionSerializer,
getBaseRoyaltiesSerializer,
getBubblegumV1Serializer,
getBubblegumV2Serializer,
getBurnDelegateSerializer,
getEditionSerializer,
getFreezeDelegateSerializer,
Expand Down Expand Up @@ -81,7 +81,7 @@ export type Plugin =
| { __kind: 'ImmutableMetadata'; fields: [ImmutableMetadata] }
| { __kind: 'VerifiedCreators'; fields: [VerifiedCreators] }
| { __kind: 'Autograph'; fields: [Autograph] }
| { __kind: 'BubblegumV1'; fields: [BubblegumV1] };
| { __kind: 'BubblegumV2'; fields: [BubblegumV2] };

export type PluginArgs =
| { __kind: 'Royalties'; fields: [BaseRoyaltiesArgs] }
Expand All @@ -102,7 +102,7 @@ export type PluginArgs =
| { __kind: 'ImmutableMetadata'; fields: [ImmutableMetadataArgs] }
| { __kind: 'VerifiedCreators'; fields: [VerifiedCreatorsArgs] }
| { __kind: 'Autograph'; fields: [AutographArgs] }
| { __kind: 'BubblegumV1'; fields: [BubblegumV1Args] };
| { __kind: 'BubblegumV2'; fields: [BubblegumV2Args] };

export function getPluginSerializer(): Serializer<PluginArgs, Plugin> {
return dataEnum<Plugin>(
Expand Down Expand Up @@ -198,9 +198,9 @@ export function getPluginSerializer(): Serializer<PluginArgs, Plugin> {
]),
],
[
'BubblegumV1',
struct<GetDataEnumKindContent<Plugin, 'BubblegumV1'>>([
['fields', tuple([getBubblegumV1Serializer()])],
'BubblegumV2',
struct<GetDataEnumKindContent<Plugin, 'BubblegumV2'>>([
['fields', tuple([getBubblegumV2Serializer()])],
]),
],
],
Expand Down Expand Up @@ -273,9 +273,9 @@ export function plugin(
data: GetDataEnumKindContent<PluginArgs, 'Autograph'>['fields']
): GetDataEnumKind<PluginArgs, 'Autograph'>;
export function plugin(
kind: 'BubblegumV1',
data: GetDataEnumKindContent<PluginArgs, 'BubblegumV1'>['fields']
): GetDataEnumKind<PluginArgs, 'BubblegumV1'>;
kind: 'BubblegumV2',
data: GetDataEnumKindContent<PluginArgs, 'BubblegumV2'>['fields']
): GetDataEnumKind<PluginArgs, 'BubblegumV2'>;
export function plugin<K extends PluginArgs['__kind']>(
kind: K,
data?: any
Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/types/pluginType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export enum PluginType {
ImmutableMetadata,
VerifiedCreators,
Autograph,
BubblegumV1,
BubblegumV2,
}

export type PluginTypeArgs = PluginType;
Expand Down
10 changes: 5 additions & 5 deletions clients/js/src/plugins/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
VerifiedCreatorsArgs,
Autograph,
VerifiedCreators,
BubblegumV1,
BubblegumV2,
} from '../generated';
import { RoyaltiesArgs, RoyaltiesPlugin } from './royalties';
import { PluginAuthority } from './pluginAuthority';
Expand Down Expand Up @@ -91,7 +91,7 @@ export type CreatePluginArgs =
type: 'AddBlocker';
}
| {
type: 'BubblegumV1';
type: 'BubblegumV2';
};

export type AuthorityArgsV2 = {
Expand All @@ -112,7 +112,7 @@ export type CreateOnlyPluginArgsV2 =
type: 'Edition';
} & EditionArgs)
| {
type: 'BubblegumV1';
type: 'BubblegumV2';
};

export type OwnerManagedPluginArgsV2 =
Expand Down Expand Up @@ -188,7 +188,7 @@ export type AddBlockerPlugin = BasePlugin & AddBlocker;
export type ImmutableMetadataPlugin = BasePlugin & ImmutableMetadata;
export type VerifiedCreatorsPlugin = BasePlugin & VerifiedCreators;
export type AutographPlugin = BasePlugin & Autograph;
export type BubblegumV1Plugin = BasePlugin & BubblegumV1;
export type BubblegumV2Plugin = BasePlugin & BubblegumV2;

export type CommonPluginsList = {
attributes?: AttributesPlugin;
Expand All @@ -212,7 +212,7 @@ export type AssetPluginsList = {

export type CollectionPluginsList = {
masterEdition?: MasterEditionPlugin;
bubblegumV1?: BubblegumV1Plugin;
bubblegumV2?: BubblegumV2Plugin;
} & CommonPluginsList;

export type PluginsList = AssetPluginsList & CollectionPluginsList;
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { createPlugin, addPluginV1 } from '../../../src';
import { createUmi } from '../../_setupRaw';
import { createAsset } from '../../_setupSdk';

test('it cannot create asset with BubblegumV1 plugin', async (t) => {
test('it cannot create asset with BubblegumV2 plugin', async (t) => {
const umi = await createUmi();
const result = createAsset(umi, {
plugins: [
{
type: 'BubblegumV1',
type: 'BubblegumV2',
},
],
});
Expand All @@ -18,14 +18,14 @@ test('it cannot create asset with BubblegumV1 plugin', async (t) => {
});
});

test('it cannot add BubblegumV1 to asset', async (t) => {
test('it cannot add BubblegumV2 to asset', async (t) => {
const umi = await createUmi();
const asset = await createAsset(umi);

const result = addPluginV1(umi, {
asset: asset.publicKey,
plugin: createPlugin({
type: 'BubblegumV1',
type: 'BubblegumV2',
}),
}).sendAndConfirm(umi);

Expand Down
Loading