-
Notifications
You must be signed in to change notification settings - Fork 187
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
base: master
Are you sure you want to change the base?
Conversation
…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'; |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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( |
There was a problem hiding this comment.
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.
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.