|
@@ -6,10 +6,9 @@ import {
|
|
FindComponentProgramDataPda,
|
|
FindComponentProgramDataPda,
|
|
FindEntityPda,
|
|
FindEntityPda,
|
|
SerializeArgs,
|
|
SerializeArgs,
|
|
- CPI_AUTH_ADDRESS,
|
|
|
|
} from "../../lib";
|
|
} from "../../lib";
|
|
import { Direction } from "../framework";
|
|
import { Direction } from "../framework";
|
|
-import { FindBufferPda } from "../../src";
|
|
|
|
|
|
+import { FindBufferPda, FindCpiAuthPda } from "../../src";
|
|
|
|
|
|
export function ecs(framework) {
|
|
export function ecs(framework) {
|
|
describe("ECS", () => {
|
|
describe("ECS", () => {
|
|
@@ -106,7 +105,7 @@ export function ecs(framework) {
|
|
data: framework.componentVelocityEntity1Pda,
|
|
data: framework.componentVelocityEntity1Pda,
|
|
componentProgram: componentId,
|
|
componentProgram: componentId,
|
|
authority: framework.provider.wallet.publicKey,
|
|
authority: framework.provider.wallet.publicKey,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.instruction();
|
|
.instruction();
|
|
const transaction = new anchor.web3.Transaction().add(instruction);
|
|
const transaction = new anchor.web3.Transaction().add(instruction);
|
|
@@ -127,7 +126,7 @@ export function ecs(framework) {
|
|
data: framework.componentPositionEntity1Pda,
|
|
data: framework.componentPositionEntity1Pda,
|
|
componentProgram: componentId,
|
|
componentProgram: componentId,
|
|
authority: framework.worldProgram.programId,
|
|
authority: framework.worldProgram.programId,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.instruction();
|
|
.instruction();
|
|
const transaction = new anchor.web3.Transaction().add(instruction);
|
|
const transaction = new anchor.web3.Transaction().add(instruction);
|
|
@@ -148,7 +147,7 @@ export function ecs(framework) {
|
|
data: componentPda,
|
|
data: componentPda,
|
|
componentProgram: componentId,
|
|
componentProgram: componentId,
|
|
authority: framework.worldProgram.programId,
|
|
authority: framework.worldProgram.programId,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.instruction();
|
|
.instruction();
|
|
const transaction = new anchor.web3.Transaction().add(instruction);
|
|
const transaction = new anchor.web3.Transaction().add(instruction);
|
|
@@ -169,7 +168,7 @@ export function ecs(framework) {
|
|
data: framework.componentPositionEntity4Pda,
|
|
data: framework.componentPositionEntity4Pda,
|
|
componentProgram: componentId,
|
|
componentProgram: componentId,
|
|
authority: framework.worldProgram.programId,
|
|
authority: framework.worldProgram.programId,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.instruction();
|
|
.instruction();
|
|
const transaction = new anchor.web3.Transaction().add(instruction);
|
|
const transaction = new anchor.web3.Transaction().add(instruction);
|
|
@@ -190,11 +189,11 @@ export function ecs(framework) {
|
|
const instruction = await framework.worldProgram.methods
|
|
const instruction = await framework.worldProgram.methods
|
|
.apply(SerializeArgs({ direction: Direction.Up }))
|
|
.apply(SerializeArgs({ direction: Direction.Up }))
|
|
.accounts({
|
|
.accounts({
|
|
- buffer: FindBufferPda(),
|
|
|
|
|
|
+ buffer: FindBufferPda(framework.provider.wallet.publicKey),
|
|
authority: framework.provider.wallet.publicKey,
|
|
authority: framework.provider.wallet.publicKey,
|
|
boltSystem: framework.systemSimpleMovement.programId,
|
|
boltSystem: framework.systemSimpleMovement.programId,
|
|
world: framework.worldPda,
|
|
world: framework.worldPda,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.remainingAccounts([
|
|
.remainingAccounts([
|
|
{
|
|
{
|
|
@@ -226,11 +225,11 @@ export function ecs(framework) {
|
|
const instruction = await framework.worldProgram.methods
|
|
const instruction = await framework.worldProgram.methods
|
|
.apply(SerializeArgs({ direction: Direction.Right }))
|
|
.apply(SerializeArgs({ direction: Direction.Right }))
|
|
.accounts({
|
|
.accounts({
|
|
- buffer: FindBufferPda(),
|
|
|
|
|
|
+ buffer: FindBufferPda(framework.provider.wallet.publicKey),
|
|
authority: framework.provider.wallet.publicKey,
|
|
authority: framework.provider.wallet.publicKey,
|
|
boltSystem: framework.systemSimpleMovement.programId,
|
|
boltSystem: framework.systemSimpleMovement.programId,
|
|
world: framework.worldPda,
|
|
world: framework.worldPda,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.remainingAccounts([
|
|
.remainingAccounts([
|
|
{
|
|
{
|
|
@@ -261,11 +260,11 @@ export function ecs(framework) {
|
|
const instruction = await framework.worldProgram.methods
|
|
const instruction = await framework.worldProgram.methods
|
|
.apply(SerializeArgs())
|
|
.apply(SerializeArgs())
|
|
.accounts({
|
|
.accounts({
|
|
- buffer: FindBufferPda(),
|
|
|
|
|
|
+ buffer: FindBufferPda(framework.provider.wallet.publicKey),
|
|
authority: framework.provider.wallet.publicKey,
|
|
authority: framework.provider.wallet.publicKey,
|
|
boltSystem: framework.systemFly.programId,
|
|
boltSystem: framework.systemFly.programId,
|
|
world: framework.worldPda,
|
|
world: framework.worldPda,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.remainingAccounts([
|
|
.remainingAccounts([
|
|
{
|
|
{
|
|
@@ -296,11 +295,11 @@ export function ecs(framework) {
|
|
const instruction = await framework.worldProgram.methods
|
|
const instruction = await framework.worldProgram.methods
|
|
.apply(SerializeArgs())
|
|
.apply(SerializeArgs())
|
|
.accounts({
|
|
.accounts({
|
|
- buffer: FindBufferPda(),
|
|
|
|
|
|
+ buffer: FindBufferPda(framework.provider.wallet.publicKey),
|
|
authority: framework.provider.wallet.publicKey,
|
|
authority: framework.provider.wallet.publicKey,
|
|
boltSystem: framework.systemApplyVelocity.programId,
|
|
boltSystem: framework.systemApplyVelocity.programId,
|
|
world: framework.worldPda,
|
|
world: framework.worldPda,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.remainingAccounts([
|
|
.remainingAccounts([
|
|
{
|
|
{
|
|
@@ -350,11 +349,11 @@ export function ecs(framework) {
|
|
const instruction = await framework.worldProgram.methods
|
|
const instruction = await framework.worldProgram.methods
|
|
.apply(SerializeArgs())
|
|
.apply(SerializeArgs())
|
|
.accounts({
|
|
.accounts({
|
|
- buffer: FindBufferPda(),
|
|
|
|
|
|
+ buffer: FindBufferPda(framework.provider.wallet.publicKey),
|
|
authority: framework.provider.wallet.publicKey,
|
|
authority: framework.provider.wallet.publicKey,
|
|
boltSystem: framework.systemApplyVelocity.programId,
|
|
boltSystem: framework.systemApplyVelocity.programId,
|
|
world: framework.worldPda,
|
|
world: framework.worldPda,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.remainingAccounts([
|
|
.remainingAccounts([
|
|
{
|
|
{
|
|
@@ -407,11 +406,11 @@ export function ecs(framework) {
|
|
const instruction = await framework.worldProgram.methods
|
|
const instruction = await framework.worldProgram.methods
|
|
.apply(SerializeArgs())
|
|
.apply(SerializeArgs())
|
|
.accounts({
|
|
.accounts({
|
|
- buffer: FindBufferPda(),
|
|
|
|
|
|
+ buffer: FindBufferPda(framework.provider.wallet.publicKey),
|
|
authority: framework.provider.wallet.publicKey,
|
|
authority: framework.provider.wallet.publicKey,
|
|
boltSystem: framework.systemFly.programId,
|
|
boltSystem: framework.systemFly.programId,
|
|
world: framework.worldPda,
|
|
world: framework.worldPda,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.remainingAccounts([
|
|
.remainingAccounts([
|
|
{
|
|
{
|
|
@@ -458,7 +457,7 @@ export function ecs(framework) {
|
|
component: framework.componentVelocityEntity1Pda,
|
|
component: framework.componentVelocityEntity1Pda,
|
|
componentProgramData: componentProgramData,
|
|
componentProgramData: componentProgramData,
|
|
receiver: keypair.publicKey,
|
|
receiver: keypair.publicKey,
|
|
- cpiAuth: CPI_AUTH_ADDRESS,
|
|
|
|
|
|
+ cpiAuth: FindCpiAuthPda(),
|
|
})
|
|
})
|
|
.instruction();
|
|
.instruction();
|
|
const transaction = new anchor.web3.Transaction().add(instruction);
|
|
const transaction = new anchor.web3.Transaction().add(instruction);
|