Skip to content

Commit 19e104c

Browse files
authored
Leant/2.0.0 (#43)
* Whitelist tests * format * upgrade to 2.0.0 + codama * CI: fix node versions for tests, enhance no only test check * regen lockfile * correct @solana/errors v * bump pnpm version
1 parent 83438b6 commit 19e104c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1334
-1054
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ jobs:
8585
EXIT_CODE=0
8686
8787
while read FILE; do
88-
if grep -Eq 'test.only\(|describe.only\(|test.skip\(|describe.skip\(' $FILE; then
89-
echo "Error: '$FILE' contains '.only' or '.skip'"
88+
if grep -Eq '(test|t|describe|d)\.(only|skip|todo|pass)\(' $FILE; then
89+
echo "Error: '$FILE' contains test modifiers (.only, .skip, .todo, or .pass)"
9090
EXIT_CODE=1
9191
fi
9292
done <<< "$FILES"

.github/workflows/test-js-client.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node: ["18.x", "20.x"]
14+
node: ["20.x", "22.x"]
1515
steps:
1616
- name: Git checkout
1717
uses: actions/checkout@v4

clients/js/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tensor-foundation/whitelist",
3-
"version": "0.3.0",
3+
"version": "1.0.0-beta.1",
44
"description": "Verify your collection on-chain",
55
"sideEffects": false,
66
"module": "./dist/src/index.mjs",
@@ -37,18 +37,18 @@
3737
"author": "Tensor Protocol Foundation <[email protected]>",
3838
"license": "Apache-2.0",
3939
"dependencies": {
40-
"@coral-xyz/anchor-errors": "^0.30.1",
41-
"@solana/web3.js": "2.0.0-preview.3"
40+
"@solana/web3.js": "^2.0.0"
4241
},
4342
"devDependencies": {
4443
"@ava/typescript": "^4.1.0",
44+
"@coral-xyz/anchor-errors": "^0.30.1",
4545
"@noble/hashes": "^1.4.0",
46-
"@solana/errors": "2.0.0-preview.3",
46+
"@solana/errors": "^2.0.0",
4747
"@solana/eslint-config-solana": "^3.0.0",
48-
"@solana/webcrypto-ed25519-polyfill": "2.0.0-preview.3",
49-
"@tensor-foundation/mpl-core": "^0.3.0",
50-
"@tensor-foundation/mpl-token-metadata": "^0.4.0",
51-
"@tensor-foundation/test-helpers": "^0.4.0",
48+
"@solana/webcrypto-ed25519-polyfill": "^2.0.0",
49+
"@tensor-foundation/mpl-core": "1.0.0-beta.1",
50+
"@tensor-foundation/mpl-token-metadata": "1.0.0-beta.1",
51+
"@tensor-foundation/test-helpers": "1.0.0-beta.1",
5252
"@types/node": "^20.14.12",
5353
"@types/uuid": "^10.0.0",
5454
"@typescript-eslint/eslint-plugin": "^6.0.0",
@@ -79,5 +79,5 @@
7979
}
8080
}
8181
},
82-
"packageManager": "pnpm@9.1.0"
82+
"packageManager": "pnpm@9.14.0"
8383
}

clients/js/pnpm-lock.yaml

Lines changed: 536 additions & 337 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/js/src/generated/accounts/authority.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {
@@ -38,6 +38,14 @@ import {
3838
} from '@solana/web3.js';
3939
import { findAuthorityPda } from '../pdas';
4040

41+
export const AUTHORITY_DISCRIMINATOR = new Uint8Array([
42+
36, 108, 254, 18, 167, 144, 27, 36,
43+
]);
44+
45+
export function getAuthorityDiscriminatorBytes() {
46+
return fixEncoderSize(getBytesEncoder(), 8).encode(AUTHORITY_DISCRIMINATOR);
47+
}
48+
4149
export type Authority = {
4250
discriminator: ReadonlyUint8Array;
4351
bump: number;
@@ -72,10 +80,7 @@ export function getAuthorityEncoder(): Encoder<AuthorityArgs> {
7280
['owner', getAddressEncoder()],
7381
['reserved', fixEncoderSize(getBytesEncoder(), 64)],
7482
]),
75-
(value) => ({
76-
...value,
77-
discriminator: new Uint8Array([36, 108, 254, 18, 167, 144, 27, 36]),
78-
})
83+
(value) => ({ ...value, discriminator: AUTHORITY_DISCRIMINATOR })
7984
);
8085
}
8186

clients/js/src/generated/accounts/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
export * from './authority';

clients/js/src/generated/accounts/mintProof.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {
@@ -38,6 +38,14 @@ import {
3838
} from '@solana/web3.js';
3939
import { MintProofSeeds, findMintProofPda } from '../pdas';
4040

41+
export const MINT_PROOF_DISCRIMINATOR = new Uint8Array([
42+
227, 131, 106, 240, 190, 48, 219, 228,
43+
]);
44+
45+
export function getMintProofDiscriminatorBytes() {
46+
return fixEncoderSize(getBytesEncoder(), 8).encode(MINT_PROOF_DISCRIMINATOR);
47+
}
48+
4149
export type MintProof = {
4250
discriminator: ReadonlyUint8Array;
4351
proofLen: number;
@@ -59,10 +67,7 @@ export function getMintProofEncoder(): Encoder<MintProofArgs> {
5967
getArrayEncoder(fixEncoderSize(getBytesEncoder(), 32), { size: 28 }),
6068
],
6169
]),
62-
(value) => ({
63-
...value,
64-
discriminator: new Uint8Array([227, 131, 106, 240, 190, 48, 219, 228]),
65-
})
70+
(value) => ({ ...value, discriminator: MINT_PROOF_DISCRIMINATOR })
6671
);
6772
}
6873

clients/js/src/generated/accounts/mintProofV2.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {
@@ -42,6 +42,16 @@ import {
4242
} from '@solana/web3.js';
4343
import { MintProofV2Seeds, findMintProofV2Pda } from '../pdas';
4444

45+
export const MINT_PROOF_V2_DISCRIMINATOR = new Uint8Array([
46+
22, 197, 150, 178, 249, 225, 183, 75,
47+
]);
48+
49+
export function getMintProofV2DiscriminatorBytes() {
50+
return fixEncoderSize(getBytesEncoder(), 8).encode(
51+
MINT_PROOF_V2_DISCRIMINATOR
52+
);
53+
}
54+
4555
export type MintProofV2 = {
4656
discriminator: ReadonlyUint8Array;
4757
/** Length of proof without padding. */
@@ -77,10 +87,7 @@ export function getMintProofV2Encoder(): Encoder<MintProofV2Args> {
7787
['creationSlot', getU64Encoder()],
7888
['payer', getAddressEncoder()],
7989
]),
80-
(value) => ({
81-
...value,
82-
discriminator: new Uint8Array([22, 197, 150, 178, 249, 225, 183, 75]),
83-
})
90+
(value) => ({ ...value, discriminator: MINT_PROOF_V2_DISCRIMINATOR })
8491
);
8592
}
8693

clients/js/src/generated/accounts/whitelist.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {
@@ -44,6 +44,14 @@ import {
4444
} from '@solana/web3.js';
4545
import { WhitelistSeeds, findWhitelistPda } from '../pdas';
4646

47+
export const WHITELIST_DISCRIMINATOR = new Uint8Array([
48+
204, 176, 52, 79, 146, 121, 54, 247,
49+
]);
50+
51+
export function getWhitelistDiscriminatorBytes() {
52+
return fixEncoderSize(getBytesEncoder(), 8).encode(WHITELIST_DISCRIMINATOR);
53+
}
54+
4755
export type Whitelist = {
4856
discriminator: ReadonlyUint8Array;
4957
version: number;
@@ -90,10 +98,7 @@ export function getWhitelistEncoder(): Encoder<WhitelistArgs> {
9098
['fvc', getOptionEncoder(getAddressEncoder())],
9199
['reserved', fixEncoderSize(getBytesEncoder(), 64)],
92100
]),
93-
(value) => ({
94-
...value,
95-
discriminator: new Uint8Array([204, 176, 52, 79, 146, 121, 54, 247]),
96-
})
101+
(value) => ({ ...value, discriminator: WHITELIST_DISCRIMINATOR })
97102
);
98103
}
99104

clients/js/src/generated/accounts/whitelistV2.ts

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {
@@ -50,6 +50,16 @@ import {
5050
type StateArgs,
5151
} from '../types';
5252

53+
export const WHITELIST_V2_DISCRIMINATOR = new Uint8Array([
54+
136, 184, 45, 191, 85, 203, 191, 119,
55+
]);
56+
57+
export function getWhitelistV2DiscriminatorBytes() {
58+
return fixEncoderSize(getBytesEncoder(), 8).encode(
59+
WHITELIST_V2_DISCRIMINATOR
60+
);
61+
}
62+
5363
export type WhitelistV2 = {
5464
discriminator: ReadonlyUint8Array;
5565
/** Whitelist version, used to control upgrades. */
@@ -102,10 +112,7 @@ export function getWhitelistV2Encoder(): Encoder<WhitelistV2Args> {
102112
['freezeAuthority', getAddressEncoder()],
103113
['conditions', getArrayEncoder(getConditionEncoder())],
104114
]),
105-
(value) => ({
106-
...value,
107-
discriminator: new Uint8Array([136, 184, 45, 191, 85, 203, 191, 119]),
108-
})
115+
(value) => ({ ...value, discriminator: WHITELIST_V2_DISCRIMINATOR })
109116
);
110117
}
111118

0 commit comments

Comments
 (0)