Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use the concrete implementation of web3.js in the getStakeActivation package #17

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

steveluscher
Copy link
Contributor

The only place that @solana/web3.js is used in this shim – in a non-type position – is here. We can make a mock of PublicKey here which breaks the last dependency on the actual implementation of @solana/web3.js. Now all that is used from that package are the types.

@steveluscher
Copy link
Contributor Author

steveluscher commented Nov 18, 2024

I don't know if this now means that we should move @solana/web3.js out of dependencies and into peerDependencies or devDependencies but I'm going to all that thinking up to @buffalojoec

'SysvarStakeHistory1111111111111111111111111'
);
const SYSVAR_STAKE_HISTORY_ADDRESS = {
toBase58: () => 'SysvarStakeHistory1111111111111111111111111',
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 works, because the only thing that parseAccountInfo() ever does with this thing is to call toBase58() on it.

‘Thin interfaces.’

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant