Skip to content

Commit

Permalink
ts: Remove StateCoder (#3224)
Browse files Browse the repository at this point in the history
  • Loading branch information
acheroncrypto authored Sep 4, 2024
1 parent 1152f90 commit 51b21ce
Show file tree
Hide file tree
Showing 28 changed files with 1 addition and 200 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ The minor version will be incremented upon a breaking change and the patch versi
- ts: Change the `Program` constructor's `idl` parameter type to `any` ([#3181](https://github.com/coral-xyz/anchor/pull/3181)).
- lang, spl: Remove `borsh 0.9` support ([#3199](https://github.com/coral-xyz/anchor/pull/3199)).
- ts: Upgrade `typescript` to `5.5.4` and remove the generic parameters of `SimulateResponse` ([#3221](https://github.com/coral-xyz/anchor/pull/3221)).
- ts: Remove `StateCoder`([#3224](https://github.com/coral-xyz/anchor/pull/3224)).

## [0.30.1] - 2024-06-20

Expand Down
5 changes: 0 additions & 5 deletions ts/packages/anchor/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ export interface Coder<A extends string = string, T extends string = string> {
readonly types: TypesCoder<T>;
}

export interface StateCoder {
encode<T = any>(name: string, account: T): Promise<Buffer>;
decode<T = any>(ix: Buffer): T;
}

export interface AccountsCoder<A extends string = string> {
encode<T = any>(accountName: A, account: T): Promise<Buffer>;
decode<T = any>(accountName: A, acc: Buffer): T;
Expand Down
3 changes: 0 additions & 3 deletions ts/packages/spl-associated-token-account/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
import { SplAssociatedTokenAccountAccountsCoder } from "./accounts";
import { SplAssociatedTokenAccountEventsCoder } from "./events";
import { SplAssociatedTokenAccountInstructionCoder } from "./instructions";
import { SplAssociatedTokenAccountStateCoder } from "./state";
import { SplAssociatedTokenAccountTypesCoder } from "./types";

/**
Expand All @@ -13,14 +12,12 @@ export class SplAssociatedTokenAccountCoder implements Coder {
readonly accounts: SplAssociatedTokenAccountAccountsCoder;
readonly events: SplAssociatedTokenAccountEventsCoder;
readonly instruction: SplAssociatedTokenAccountInstructionCoder;
readonly state: SplAssociatedTokenAccountStateCoder;
readonly types: SplAssociatedTokenAccountTypesCoder;

constructor(idl: Idl) {
this.accounts = new SplAssociatedTokenAccountAccountsCoder(idl);
this.events = new SplAssociatedTokenAccountEventsCoder(idl);
this.instruction = new SplAssociatedTokenAccountInstructionCoder(idl);
this.state = new SplAssociatedTokenAccountStateCoder(idl);
this.types = new SplAssociatedTokenAccountTypesCoder(idl);
}
}
12 changes: 0 additions & 12 deletions ts/packages/spl-associated-token-account/src/coder/state.ts

This file was deleted.

3 changes: 0 additions & 3 deletions ts/packages/spl-binary-option/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
import { SplBinaryOptionAccountsCoder } from "./accounts";
import { SplBinaryOptionEventsCoder } from "./events";
import { SplBinaryOptionInstructionCoder } from "./instructions";
import { SplBinaryOptionStateCoder } from "./state";
import { SplBinaryOptionTypesCoder } from "./types";

/**
Expand All @@ -13,14 +12,12 @@ export class SplBinaryOptionCoder implements Coder {
readonly accounts: SplBinaryOptionAccountsCoder;
readonly events: SplBinaryOptionEventsCoder;
readonly instruction: SplBinaryOptionInstructionCoder;
readonly state: SplBinaryOptionStateCoder;
readonly types: SplBinaryOptionTypesCoder;

constructor(idl: Idl) {
this.accounts = new SplBinaryOptionAccountsCoder(idl);
this.events = new SplBinaryOptionEventsCoder(idl);
this.instruction = new SplBinaryOptionInstructionCoder(idl);
this.state = new SplBinaryOptionStateCoder(idl);
this.types = new SplBinaryOptionTypesCoder(idl);
}
}
12 changes: 0 additions & 12 deletions ts/packages/spl-binary-option/src/coder/state.ts

This file was deleted.

3 changes: 0 additions & 3 deletions ts/packages/spl-binary-oracle-pair/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
import { SplBinaryOraclePairAccountsCoder } from "./accounts";
import { SplBinaryOraclePairEventsCoder } from "./events";
import { SplBinaryOraclePairInstructionCoder } from "./instructions";
import { SplBinaryOraclePairStateCoder } from "./state";
import { SplBinaryOraclePairTypesCoder } from "./types";

/**
Expand All @@ -13,14 +12,12 @@ export class SplBinaryOraclePairCoder implements Coder {
readonly accounts: SplBinaryOraclePairAccountsCoder;
readonly events: SplBinaryOraclePairEventsCoder;
readonly instruction: SplBinaryOraclePairInstructionCoder;
readonly state: SplBinaryOraclePairStateCoder;
readonly types: SplBinaryOraclePairTypesCoder;

constructor(idl: Idl) {
this.accounts = new SplBinaryOraclePairAccountsCoder(idl);
this.events = new SplBinaryOraclePairEventsCoder(idl);
this.instruction = new SplBinaryOraclePairInstructionCoder(idl);
this.state = new SplBinaryOraclePairStateCoder(idl);
this.types = new SplBinaryOraclePairTypesCoder(idl);
}
}
12 changes: 0 additions & 12 deletions ts/packages/spl-binary-oracle-pair/src/coder/state.ts

This file was deleted.

3 changes: 0 additions & 3 deletions ts/packages/spl-feature-proposal/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
import { SplFeatureProposalAccountsCoder } from "./accounts";
import { SplFeatureProposalEventsCoder } from "./events";
import { SplFeatureProposalInstructionCoder } from "./instructions";
import { SplFeatureProposalStateCoder } from "./state";
import { SplFeatureProposalTypesCoder } from "./types";

/**
Expand All @@ -13,14 +12,12 @@ export class SplFeatureProposalCoder implements Coder {
readonly accounts: SplFeatureProposalAccountsCoder;
readonly events: SplFeatureProposalEventsCoder;
readonly instruction: SplFeatureProposalInstructionCoder;
readonly state: SplFeatureProposalStateCoder;
readonly types: SplFeatureProposalTypesCoder;

constructor(idl: Idl) {
this.accounts = new SplFeatureProposalAccountsCoder(idl);
this.events = new SplFeatureProposalEventsCoder(idl);
this.instruction = new SplFeatureProposalInstructionCoder(idl);
this.state = new SplFeatureProposalStateCoder(idl);
this.types = new SplFeatureProposalTypesCoder(idl);
}
}
12 changes: 0 additions & 12 deletions ts/packages/spl-feature-proposal/src/coder/state.ts

This file was deleted.

3 changes: 0 additions & 3 deletions ts/packages/spl-governance/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
import { SplGovernanceAccountsCoder } from "./accounts";
import { SplGovernanceEventsCoder } from "./events";
import { SplGovernanceInstructionCoder } from "./instructions";
import { SplGovernanceStateCoder } from "./state";
import { SplGovernanceTypesCoder } from "./types";

/**
Expand All @@ -13,14 +12,12 @@ export class SplGovernanceCoder implements Coder {
readonly accounts: SplGovernanceAccountsCoder;
readonly events: SplGovernanceEventsCoder;
readonly instruction: SplGovernanceInstructionCoder;
readonly state: SplGovernanceStateCoder;
readonly types: SplGovernanceTypesCoder;

constructor(idl: Idl) {
this.accounts = new SplGovernanceAccountsCoder(idl);
this.events = new SplGovernanceEventsCoder(idl);
this.instruction = new SplGovernanceInstructionCoder(idl);
this.state = new SplGovernanceStateCoder(idl);
this.types = new SplGovernanceTypesCoder(idl);
}
}
12 changes: 0 additions & 12 deletions ts/packages/spl-governance/src/coder/state.ts

This file was deleted.

3 changes: 0 additions & 3 deletions ts/packages/spl-memo/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
import { SplMemoAccountsCoder } from "./accounts";
import { SplMemoEventsCoder } from "./events";
import { SplMemoInstructionCoder } from "./instructions";
import { SplMemoStateCoder } from "./state";
import { SplMemoTypesCoder } from "./types";

/**
Expand All @@ -13,14 +12,12 @@ export class SplMemoCoder implements Coder {
readonly accounts: SplMemoAccountsCoder;
readonly events: SplMemoEventsCoder;
readonly instruction: SplMemoInstructionCoder;
readonly state: SplMemoStateCoder;
readonly types: SplMemoTypesCoder;

constructor(idl: Idl) {
this.accounts = new SplMemoAccountsCoder(idl);
this.events = new SplMemoEventsCoder(idl);
this.instruction = new SplMemoInstructionCoder(idl);
this.state = new SplMemoStateCoder(idl);
this.types = new SplMemoTypesCoder(idl);
}
}
12 changes: 0 additions & 12 deletions ts/packages/spl-memo/src/coder/state.ts

This file was deleted.

3 changes: 0 additions & 3 deletions ts/packages/spl-name-service/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
import { SplNameServiceAccountsCoder } from "./accounts";
import { SplNameServiceEventsCoder } from "./events";
import { SplNameServiceInstructionCoder } from "./instructions";
import { SplNameServiceStateCoder } from "./state";
import { SplNameServiceTypesCoder } from "./types";

/**
Expand All @@ -13,14 +12,12 @@ export class SplNameServiceCoder implements Coder {
readonly accounts: SplNameServiceAccountsCoder;
readonly events: SplNameServiceEventsCoder;
readonly instruction: SplNameServiceInstructionCoder;
readonly state: SplNameServiceStateCoder;
readonly types: SplNameServiceTypesCoder;

constructor(idl: Idl) {
this.accounts = new SplNameServiceAccountsCoder(idl);
this.events = new SplNameServiceEventsCoder(idl);
this.instruction = new SplNameServiceInstructionCoder(idl);
this.state = new SplNameServiceStateCoder(idl);
this.types = new SplNameServiceTypesCoder(idl);
}
}
12 changes: 0 additions & 12 deletions ts/packages/spl-name-service/src/coder/state.ts

This file was deleted.

3 changes: 0 additions & 3 deletions ts/packages/spl-record/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
import { SplRecordAccountsCoder } from "./accounts";
import { SplRecordEventsCoder } from "./events";
import { SplRecordInstructionCoder } from "./instructions";
import { SplRecordStateCoder } from "./state";
import { SplRecordTypesCoder } from "./types";

/**
Expand All @@ -13,14 +12,12 @@ export class SplRecordCoder implements Coder {
readonly accounts: SplRecordAccountsCoder;
readonly events: SplRecordEventsCoder;
readonly instruction: SplRecordInstructionCoder;
readonly state: SplRecordStateCoder;
readonly types: SplRecordTypesCoder;

constructor(idl: Idl) {
this.accounts = new SplRecordAccountsCoder(idl);
this.events = new SplRecordEventsCoder(idl);
this.instruction = new SplRecordInstructionCoder(idl);
this.state = new SplRecordStateCoder(idl);
this.types = new SplRecordTypesCoder(idl);
}
}
12 changes: 0 additions & 12 deletions ts/packages/spl-record/src/coder/state.ts

This file was deleted.

3 changes: 0 additions & 3 deletions ts/packages/spl-stake-pool/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
import { SplStakePoolAccountsCoder } from "./accounts";
import { SplStakePoolEventsCoder } from "./events";
import { SplStakePoolInstructionCoder } from "./instructions";
import { SplStakePoolStateCoder } from "./state";
import { SplStakePoolTypesCoder } from "./types";

/**
Expand All @@ -13,14 +12,12 @@ export class SplStakePoolCoder implements Coder {
readonly accounts: SplStakePoolAccountsCoder;
readonly events: SplStakePoolEventsCoder;
readonly instruction: SplStakePoolInstructionCoder;
readonly state: SplStakePoolStateCoder;
readonly types: SplStakePoolTypesCoder;

constructor(idl: Idl) {
this.accounts = new SplStakePoolAccountsCoder(idl);
this.events = new SplStakePoolEventsCoder(idl);
this.instruction = new SplStakePoolInstructionCoder(idl);
this.state = new SplStakePoolStateCoder(idl);
this.types = new SplStakePoolTypesCoder(idl);
}
}
12 changes: 0 additions & 12 deletions ts/packages/spl-stake-pool/src/coder/state.ts

This file was deleted.

3 changes: 0 additions & 3 deletions ts/packages/spl-stateless-asks/src/coder/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
import { SplStatelessAsksAccountsCoder } from "./accounts";
import { SplStatelessAsksEventsCoder } from "./events";
import { SplStatelessAsksInstructionCoder } from "./instructions";
import { SplStatelessAsksStateCoder } from "./state";
import { SplStatelessAsksTypesCoder } from "./types";

/**
Expand All @@ -13,14 +12,12 @@ export class SplStatelessAsksCoder implements Coder {
readonly accounts: SplStatelessAsksAccountsCoder;
readonly events: SplStatelessAsksEventsCoder;
readonly instruction: SplStatelessAsksInstructionCoder;
readonly state: SplStatelessAsksStateCoder;
readonly types: SplStatelessAsksTypesCoder;

constructor(idl: Idl) {
this.accounts = new SplStatelessAsksAccountsCoder(idl);
this.events = new SplStatelessAsksEventsCoder(idl);
this.instruction = new SplStatelessAsksInstructionCoder(idl);
this.state = new SplStatelessAsksStateCoder(idl);
this.types = new SplStatelessAsksTypesCoder(idl);
}
}
12 changes: 0 additions & 12 deletions ts/packages/spl-stateless-asks/src/coder/state.ts

This file was deleted.

Loading

0 comments on commit 51b21ce

Please sign in to comment.