-
Notifications
You must be signed in to change notification settings - Fork 13
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
refactor:[SMR-2730] rewrite get tx data #1781
Conversation
…into smr-2730-rewrite-getTxData
currentBridgeMethods.native, | ||
[amount], | ||
), BridgeErrorType.INTERNAL_ERROR); | ||
functionName = currentBridgeMethods.native; |
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.
the new way of doing it feels a lot easier to read to me
@@ -384,39 +384,40 @@ export class TokenBridge { | |||
const currentBridgeMethods = await this.getBridgeMethods(direction); | |||
const bridgeContract = await this.getBridgeContract(direction); | |||
|
|||
let functionName: string; | |||
let parameters: any[]; | |||
/** | |||
* Handle bridge transaction for native token | |||
*/ | |||
if (token.toUpperCase() === NATIVE) { | |||
if (sender === recipient) { |
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.
should we handle scenario where a checksummed version of an address might evaluate different from a non-checksummed version?
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.
Yep. Ticket created
Summary
Rewrite
getTxData
in bridge SDKDetail and impact of the change
If you do not think this is a better way to write this function, please voice this opinion. I personally believe it is easier to read.
Changed
getTxData
so you just set the function name and parameters then generate the calldata based on those, since you already have the correct bridge contract to do it on as well.