-
Notifications
You must be signed in to change notification settings - Fork 5
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
merge from beets #376
merge from beets #376
Conversation
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.
As a general comment, we could improve the config around code using isBalancerProject
but I think you already talked about this with @garethfuller
Approved but let's wait for Gareth to do another review.
export function parseLstStakeReceipt({ receiptLogs, userAddress, chain, getToken }: ParseProps) { | ||
const receivedToken: HumanTokenAmount[] = getIncomingLogs(receiptLogs, userAddress).map(log => { | ||
const tokenDecimals = getToken(log.address, chain)?.decimals | ||
return _toHumanAmount(log.address, log.args.value, tokenDecimals) | ||
}) | ||
|
||
return { | ||
receivedToken, | ||
} | ||
} | ||
|
||
export function parseLstUnstakeReceipt({ receiptLogs, userAddress, chain, getToken }: ParseProps) { | ||
const receivedToken: HumanTokenAmount[] = getIncomingLogs(receiptLogs, userAddress).map(log => { | ||
const tokenDecimals = getToken(log.address, chain)?.decimals | ||
return _toHumanAmount(log.address, log.args.value, tokenDecimals) | ||
}) | ||
|
||
return { | ||
receivedToken, | ||
} | ||
} | ||
|
||
export function parseLstWithdrawReceipt({ receiptLogs, userAddress, chain, getToken }: ParseProps) { | ||
const receivedToken: HumanTokenAmount[] = getIncomingLogs(receiptLogs, userAddress).map(log => { | ||
const tokenDecimals = getToken(log.address, chain)?.decimals | ||
return _toHumanAmount(log.address, log.args.value, tokenDecimals) | ||
}) | ||
|
||
return { | ||
receivedToken, | ||
} | ||
} |
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.
You shouldn't need to parse receipts for staking/unstaking because there is no
slippage. The only reason we do receipt states in the add/remove/swap flow is
because the amounts can change between preview and confirmation. I think it's
likely all this should be removed.
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.
for the unstaking you are right, there is no token transferred at that stage so i have removed it
for staking and withdrawing though, tokens are transferred and i have updated the parsers to correctly parse the logs for that
i also updated the tests for there 2 parsers
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.
In general looks good, my biggest concern is the receipt parsers/steps for LST staking. I'm pretty sure we shouldn't be doing that. Like we don't use receipt steps for staking/unstaking bpt. Could be wrong though?
No description provided.