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

AMM Freeze Authorities #39

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

Conversation

bhgames
Copy link

@bhgames bhgames commented Mar 29, 2021

Necessary changes to have freeze bit mask working and freeze authority working, also removed some deprecated structs and code and left better notations on the others.

Relates to solana-labs/solana-program-library#1515

The new prettier standards we use (120 length lines + ' quotes) caused reformatting in the files I touched, and while this isn't a problem in the smaller ones, there was one large one that got touched (pools.tsx) that caused a lot of noisy changes that aren't real. For ease of reading, I notated the ACTUAL changes I made with comments so please scroll through the file to find those. I notated at the beginning of the long file that this is so.

…y working, also removed some deprecated structs and code and left better notations on the others
SWAP_PROGRAM_OWNER_FEE_ADDRESS,
WRAPPED_SOL_MINT,
} from "./ids";
import { Account, AccountInfo, Connection, PublicKey, SystemProgram, TransactionInstruction } from '@solana/web3.js';
Copy link
Author

Choose a reason for hiding this comment

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

This file got auto formatted by our new pretty standards, so Im going to mark with comments where to look for actual changes.

} else {
result.data = layout.decode(item.account.data);
let layout;
switch (item.account.data.length) {
Copy link
Author

Choose a reason for hiding this comment

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

here, switched to case statement

result.data = layout.decode(item.account.data);
let pool = toPoolInfo(result, swapId);
pool.legacy = isLegacy;
poolsArray.push(pool as PoolInfo);
Copy link
Author

Choose a reason for hiding this comment

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

Got rid of legacy handler here

poolsArray.push(pool as PoolInfo);
}
let pool = toPoolInfo(result, swapId);
pool.legacy = isLegacy;
Copy link
Author

Choose a reason for hiding this comment

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

see this code is unindented now because the if/else is gone

});
}

export async function setFreezeAuthorityBitMask(
Copy link
Author

Choose a reason for hiding this comment

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

This is a new action that isn't hooked up anywhere in the UI but I used it with a transient button to successfully integration test the functionality in the contract. Can be hooked up to a UI later.

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