@@ -362,14 +362,14 @@ export async function DestroyComponent({
362362 const program = new Program (
363363 worldIdl as Idl ,
364364 ) as unknown as Program < WorldProgram > ;
365- const componentName = component . getMethodDiscriminator ( "destroy" ) ;
365+ const discriminator = component . getMethodDiscriminator ( "destroy" ) ;
366366 const componentProgram = component . program ;
367367 const componentProgramData = FindComponentProgramDataPda ( {
368368 programId : componentProgram ,
369369 } ) ;
370370 const componentPda = component . pda ( entity , seed ) ;
371371 const instruction = await program . methods
372- . destroyComponent ( GetDiscriminator ( componentName ) )
372+ . destroyComponent ( discriminator )
373373 . accounts ( {
374374 authority,
375375 component : componentPda ,
@@ -417,15 +417,15 @@ export async function InitializeComponent({
417417 componentPda : PublicKey ;
418418} > {
419419 const component = Component . from ( componentId ) ;
420- const componentName = component . getMethodDiscriminator ( "initialize" ) ;
420+ const discriminator = component . getMethodDiscriminator ( "initialize" ) ;
421421 const componentProgram = component . program ;
422422 const componentPda = component . pda ( entity , seed ) ;
423423 const program = new Program (
424424 worldIdl as Idl ,
425425 ) as unknown as Program < WorldProgram > ;
426426
427427 const instruction = await program . methods
428- . initializeComponent ( GetDiscriminator ( componentName ) )
428+ . initializeComponent ( discriminator )
429429 . accounts ( {
430430 payer,
431431 entity,
@@ -516,16 +516,12 @@ async function createApplySystemInstruction({
516516
517517 // Build discriminators per component in order of remaining accounts pairs
518518 const discriminators : Buffer [ ] = components . map ( ( component ) =>
519- Buffer . from (
520- Component . from ( component . id ) . getMethodDiscriminator (
521- session ? "update_with_session" : "update" ,
522- ) ,
519+ Component . from ( component . id ) . getMethodDiscriminator (
520+ session ? "update_with_session" : "update" ,
523521 ) ,
524522 ) ;
525523
526- const systemDiscriminator = Buffer . from (
527- system . getMethodDiscriminator ( "bolt_execute" ) ,
528- ) ;
524+ const systemDiscriminator = system . getMethodDiscriminator ( "bolt_execute" ) ;
529525
530526 if ( session )
531527 return program . methods
0 commit comments