-
Notifications
You must be signed in to change notification settings - Fork 54
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.
Minor comments.
As for the behaviour, was it supposed to work already?
I guess not, as the account I tried had gchain claims and it failed.
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.
I'm approving, but i think the redux state could be different.
We already know if there's a tx going on of swapVcow. You just make a hook wich filters tx by swapVcow == true
return | ||
} | ||
|
||
setSwapVCowStatus(SwapVCowStatus.ATTEMPTING) |
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.
I already mentioned in some other PR but i was not 100% sure about this approach.
Why a global unique status? Are we sure we want to take this approach? In principle you can send a claimAll and before is mined send another one.
I guess you are right this approach is simpler, only allowing the user to do one at a time, but we could just do the same thing and have a hook that return if there's any claimAll going on
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.
Why a global unique status? Are we sure we want to take this approach? In principle you can send a claimAll and before is mined send another one.
The issue is if we don't set some unique status while the swap transaction is being mined the vested amount is still the same (coming from the hook) as it was before the transaction was sent until its mined, so the user would think that something wasn't right and probably try to swap again because the UI doesn't reflect the change
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.
okok, maybe we can leave it for now...
But, it could just be opening the modal the attempting
, the submitted
cold be derived from what i just mentioned above, and initial
is just not needed. I feel we overcomplicate (maybe i miss somthing)
} | ||
|
||
const args: { from: string; gasLimit?: BigNumber } = { | ||
from: account, |
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.
nit: are you sure we want to include this? I thought in the call we mentioned this was not needed (approve and wrap don't have it and is implied in the wallet)
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.
My understanding was that we want to add this because some wallets calculate this badly
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.
My understanding was that we want to add this because some wallets calculate this badly
Why do you say this? Also if this is the case, why aren't we doing it in the wrapping an approve?
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.
It is there @anxolin 😂
return tokenContract.estimateGas.approve(spender, amountToApprove.quotient.toString()).catch((error) => { |
|
||
args.gasLimit = estimatedGas | ||
|
||
const summary = `Convert vCOW for COW` |
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 a future PR, and with less prio, we could try to get an estimation on how much we are swapping approximately?
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.
i think this is absolutely not necessary. adding the amount in the modal will not be accurate and may cause MORE confusion with users saying "oh but the modal showed this but i got xx" and the fact that it's vesting linearly. i think it's better to leave it as is, with no amount
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.
@W3stside On a second thought, I think in practice the deviation of amounts is likely negligible for most account balances. Unless you own millions of vCOW token where it can be somewhat noticeable in mere minutes, right?
Hey @nenadV91 , swapping works! Also, we use inconsistent naming of the procedure: We press on the 'Convert' button, and we call 'Swap' action (swap is displayed in the modal/activity history, the button is changed to 'Swapping..'). So, I think, we should use whether 'Convert/converting..' everywhere, or 'Swap/Swapping' As an enhancement I'd like to propose to show vCOW and COW icons in the activity modal history |
I think given this is a on-chain transaction, the transaction modal is closer to the UNWRAP and WRAP modal. Some text suggestions for the modal (if possible in this PR).
|
6360b77
to
d1b2b13
Compare
Hey @nenadV91 , looks much better! Also, could you please change the converting modal text according to @fairlighteth notes above? |
I have noticed, that we do not have 'Cancelling' or 'Cancelled' states for the Convert transactions. Also, I have a pending forever transaction when I speed up it. |
It should work on Rinkeby. I changed the claim repo variable so I think that is why its not working on gchain and mainet. |
@nenadV91 , tiny nitpick 'Convert vCOW to COW' |
6c3caf7
to
69d8a64
Compare
The button's states/changed text on it looks good to me! and resolve these case #2577 (comment) |
9bd31f9
to
b3f1a17
Compare
@elena-zh Regarding cancelation issue I don't think this is specifically related to this PR because I tried to do the same for wrap and claim and also stuck on infinite pending. Maybe it has to do something with the new Rinkeby addresses we use but I am not sure. |
@fairlighteth Do you have some idea what is this about. Is the issue related to existing code or is this something new we need to add? |
Apart from cancel and those icons, the rest of the things mentioned in PR should be fixed now. |
I checked and it doesn't output any image in the DOM. Checking in on
|
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.
👍🏼
@nenadV91 merge this so @davidalbela can test the subsidy better. I think is mostly fine. Some nitpicks we found. Also I think we should not set this to 0, but just show clearly that something is happening. The button message helps. Maybe even a shimmer effect. But the amount i wouldn't change it until the trade is executed. |
If I recall correctly, this has to do with Blocknative API. Speed ups/cancellations are a tx replacement with the same nonce. If you want I can dig deeper and take a look at that. |
Ok I am merging this and we can address these comments in the future PR's |
@nenadV91 , @alfetopito , I see. Thank you for the explanation. I opened #2583 issue for this. |
Summary