Skip to content

Commit 1cf99c3

Browse files
ts: Remove StateCoder (otter-sec#3224)
1 parent c766459 commit 1cf99c3

28 files changed

Lines changed: 1 addition & 200 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ The minor version will be incremented upon a breaking change and the patch versi
8585
- ts: Change the `Program` constructor's `idl` parameter type to `any` ([#3181](https://github.com/coral-xyz/anchor/pull/3181)).
8686
- lang, spl: Remove `borsh 0.9` support ([#3199](https://github.com/coral-xyz/anchor/pull/3199)).
8787
- ts: Upgrade `typescript` to `5.5.4` and remove the generic parameters of `SimulateResponse` ([#3221](https://github.com/coral-xyz/anchor/pull/3221)).
88+
- ts: Remove `StateCoder`([#3224](https://github.com/coral-xyz/anchor/pull/3224)).
8889

8990
## [0.30.1] - 2024-06-20
9091

ts/packages/anchor/src/coder/index.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ export interface Coder<A extends string = string, T extends string = string> {
2929
readonly types: TypesCoder<T>;
3030
}
3131

32-
export interface StateCoder {
33-
encode<T = any>(name: string, account: T): Promise<Buffer>;
34-
decode<T = any>(ix: Buffer): T;
35-
}
36-
3732
export interface AccountsCoder<A extends string = string> {
3833
encode<T = any>(accountName: A, account: T): Promise<Buffer>;
3934
decode<T = any>(accountName: A, acc: Buffer): T;

ts/packages/spl-associated-token-account/src/coder/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
33
import { SplAssociatedTokenAccountAccountsCoder } from "./accounts";
44
import { SplAssociatedTokenAccountEventsCoder } from "./events";
55
import { SplAssociatedTokenAccountInstructionCoder } from "./instructions";
6-
import { SplAssociatedTokenAccountStateCoder } from "./state";
76
import { SplAssociatedTokenAccountTypesCoder } from "./types";
87

98
/**
@@ -13,14 +12,12 @@ export class SplAssociatedTokenAccountCoder implements Coder {
1312
readonly accounts: SplAssociatedTokenAccountAccountsCoder;
1413
readonly events: SplAssociatedTokenAccountEventsCoder;
1514
readonly instruction: SplAssociatedTokenAccountInstructionCoder;
16-
readonly state: SplAssociatedTokenAccountStateCoder;
1715
readonly types: SplAssociatedTokenAccountTypesCoder;
1816

1917
constructor(idl: Idl) {
2018
this.accounts = new SplAssociatedTokenAccountAccountsCoder(idl);
2119
this.events = new SplAssociatedTokenAccountEventsCoder(idl);
2220
this.instruction = new SplAssociatedTokenAccountInstructionCoder(idl);
23-
this.state = new SplAssociatedTokenAccountStateCoder(idl);
2421
this.types = new SplAssociatedTokenAccountTypesCoder(idl);
2522
}
2623
}

ts/packages/spl-associated-token-account/src/coder/state.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

ts/packages/spl-binary-option/src/coder/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
33
import { SplBinaryOptionAccountsCoder } from "./accounts";
44
import { SplBinaryOptionEventsCoder } from "./events";
55
import { SplBinaryOptionInstructionCoder } from "./instructions";
6-
import { SplBinaryOptionStateCoder } from "./state";
76
import { SplBinaryOptionTypesCoder } from "./types";
87

98
/**
@@ -13,14 +12,12 @@ export class SplBinaryOptionCoder implements Coder {
1312
readonly accounts: SplBinaryOptionAccountsCoder;
1413
readonly events: SplBinaryOptionEventsCoder;
1514
readonly instruction: SplBinaryOptionInstructionCoder;
16-
readonly state: SplBinaryOptionStateCoder;
1715
readonly types: SplBinaryOptionTypesCoder;
1816

1917
constructor(idl: Idl) {
2018
this.accounts = new SplBinaryOptionAccountsCoder(idl);
2119
this.events = new SplBinaryOptionEventsCoder(idl);
2220
this.instruction = new SplBinaryOptionInstructionCoder(idl);
23-
this.state = new SplBinaryOptionStateCoder(idl);
2421
this.types = new SplBinaryOptionTypesCoder(idl);
2522
}
2623
}

ts/packages/spl-binary-option/src/coder/state.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

ts/packages/spl-binary-oracle-pair/src/coder/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
33
import { SplBinaryOraclePairAccountsCoder } from "./accounts";
44
import { SplBinaryOraclePairEventsCoder } from "./events";
55
import { SplBinaryOraclePairInstructionCoder } from "./instructions";
6-
import { SplBinaryOraclePairStateCoder } from "./state";
76
import { SplBinaryOraclePairTypesCoder } from "./types";
87

98
/**
@@ -13,14 +12,12 @@ export class SplBinaryOraclePairCoder implements Coder {
1312
readonly accounts: SplBinaryOraclePairAccountsCoder;
1413
readonly events: SplBinaryOraclePairEventsCoder;
1514
readonly instruction: SplBinaryOraclePairInstructionCoder;
16-
readonly state: SplBinaryOraclePairStateCoder;
1715
readonly types: SplBinaryOraclePairTypesCoder;
1816

1917
constructor(idl: Idl) {
2018
this.accounts = new SplBinaryOraclePairAccountsCoder(idl);
2119
this.events = new SplBinaryOraclePairEventsCoder(idl);
2220
this.instruction = new SplBinaryOraclePairInstructionCoder(idl);
23-
this.state = new SplBinaryOraclePairStateCoder(idl);
2421
this.types = new SplBinaryOraclePairTypesCoder(idl);
2522
}
2623
}

ts/packages/spl-binary-oracle-pair/src/coder/state.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

ts/packages/spl-feature-proposal/src/coder/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Idl, Coder } from "@coral-xyz/anchor";
33
import { SplFeatureProposalAccountsCoder } from "./accounts";
44
import { SplFeatureProposalEventsCoder } from "./events";
55
import { SplFeatureProposalInstructionCoder } from "./instructions";
6-
import { SplFeatureProposalStateCoder } from "./state";
76
import { SplFeatureProposalTypesCoder } from "./types";
87

98
/**
@@ -13,14 +12,12 @@ export class SplFeatureProposalCoder implements Coder {
1312
readonly accounts: SplFeatureProposalAccountsCoder;
1413
readonly events: SplFeatureProposalEventsCoder;
1514
readonly instruction: SplFeatureProposalInstructionCoder;
16-
readonly state: SplFeatureProposalStateCoder;
1715
readonly types: SplFeatureProposalTypesCoder;
1816

1917
constructor(idl: Idl) {
2018
this.accounts = new SplFeatureProposalAccountsCoder(idl);
2119
this.events = new SplFeatureProposalEventsCoder(idl);
2220
this.instruction = new SplFeatureProposalInstructionCoder(idl);
23-
this.state = new SplFeatureProposalStateCoder(idl);
2421
this.types = new SplFeatureProposalTypesCoder(idl);
2522
}
2623
}

ts/packages/spl-feature-proposal/src/coder/state.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)