Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Rewrite the legacy token tests without @solana/spl-token #2821

Conversation

steveluscher
Copy link
Contributor

No description provided.

Copy link

changeset-bot bot commented Jun 14, 2024

⚠️ No Changeset found

Latest commit: 21a7add

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@steveluscher steveluscher force-pushed the 06-14-fixed_a_bug_where_the_rpc_coalescer_would_leave_the_application_with_no_request_even_though_there_were_consumers branch from e572c09 to 341c8b8 Compare June 14, 2024 17:41
@steveluscher steveluscher force-pushed the 06-14_Rewrite_the_legacy_token_tests_without_solana_spl-token branch from e6282c6 to 3513521 Compare June 14, 2024 17:42
@steveluscher steveluscher force-pushed the 06-14_Rewrite_the_legacy_token_tests_without_solana_spl-token branch from 3513521 to 9ecc35e Compare June 14, 2024 17:46

const accountsWithProgramFilter = (
await connection.getTokenAccountsByOwner(testOwnerKeypair.publicKey, {
programId: TOKEN_PROGRAM_ID,
})
).value;
expect(accountsWithProgramFilter).to.have.length(3);
expect(accountsWithProgramFilter).to.have.length(1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not exactly the same as the prior test, but it's close enough. We're not meant to be testing the underlying RPC here.

@steveluscher steveluscher force-pushed the 06-14_Rewrite_the_legacy_token_tests_without_solana_spl-token branch from 9ecc35e to 4aa20b3 Compare June 14, 2024 17:48
Comment on lines -10214 to -10241
'@solana/[email protected]([email protected])':
dependencies:
'@solana/codecs': 2.0.0-preview.2([email protected])
'@solana/spl-type-length-value': 0.1.0
transitivePeerDependencies:
- fastestsmallesttextencoderdecoder

'@solana/[email protected]([email protected])':
dependencies:
'@solana/codecs': 2.0.0-preview.2([email protected])
'@solana/spl-type-length-value': 0.1.0
transitivePeerDependencies:
- fastestsmallesttextencoderdecoder

'@solana/[email protected]([email protected])':
dependencies:
'@solana/buffer-layout': 4.0.1
'@solana/buffer-layout-utils': 0.2.0
'@solana/spl-token-group': 0.0.4([email protected])
'@solana/spl-token-metadata': 0.1.4([email protected])
buffer: 6.0.3
transitivePeerDependencies:
- fastestsmallesttextencoderdecoder

'@solana/[email protected]':
dependencies:
buffer: 6.0.3

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

200w.gif

Comment on lines +4929 to +4934
new Uint8Array([
153, 120, 247, 45, 160, 119, 144, 219, 220, 209, 73, 91, 210, 102, 31,
136, 155, 12, 68, 27, 226, 215, 61, 214, 10, 245, 247, 180, 236, 63,
100, 202, 140, 247, 112, 54, 120, 32, 168, 118, 72, 115, 190, 34, 171,
126, 15, 119, 252, 173, 50, 173, 8, 10, 96, 239, 21, 32, 94, 67, 37,
43, 145, 249,
]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this should be a fixture somewhere, like scripts/keypairs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I at least wrote a comment to note what the pubkey is and where to find the fixture.

programId: new PublicKey(
'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA',
),
data: Buffer.from([3, 1, 0, 0, 0, 0, 0, 0, 0]),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just add a comment here for clarity on the bytes?

Comment on lines 4922 to 4923
const payerPublicKey = new PublicKey(
'6bffFjUMnnk3tXFJAS8pp9tz6m7oJAd27vm9rKqnLtVv',
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this even needed anymore? Looks like no.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used in one dumb place and I was too lazy to see if I could replace it. Let me see.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gone!

@steveluscher steveluscher force-pushed the 06-14_Rewrite_the_legacy_token_tests_without_solana_spl-token branch 2 times, most recently from 3fef1d9 to ea7da77 Compare June 14, 2024 17:59
Base automatically changed from 06-14-fixed_a_bug_where_the_rpc_coalescer_would_leave_the_application_with_no_request_even_though_there_were_consumers to master June 14, 2024 18:01
@steveluscher steveluscher force-pushed the 06-14_Rewrite_the_legacy_token_tests_without_solana_spl-token branch from ea7da77 to b305df6 Compare June 14, 2024 18:01
@steveluscher steveluscher force-pushed the 06-14_Rewrite_the_legacy_token_tests_without_solana_spl-token branch from b305df6 to 21a7add Compare June 14, 2024 18:02
Copy link
Contributor Author

steveluscher commented Jun 14, 2024

Merge activity

@steveluscher steveluscher merged commit e1ec67e into master Jun 14, 2024
7 of 8 checks passed
@steveluscher steveluscher deleted the 06-14_Rewrite_the_legacy_token_tests_without_solana_spl-token branch June 14, 2024 18:11
Copy link
Contributor

github-actions bot commented Jul 3, 2024

Because there has been no activity on this PR for 14 days since it was merged, it has been automatically locked. Please open a new issue if it requires a follow up.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants