Keydonix / liquid-long

The Unlicense
8 stars 1 forks source link

An ugly hack. #111

Closed MicahZoltu closed 5 years ago

MicahZoltu commented 5 years ago

I really don't like this, but I'm practicing my duct tape and bailing wire skills. The fundamental problem is that the low level code has no way to know whether any given off-chain call will work properly without a valid sender (address 0 sender) or not. The open UI works entirely without a valid sender, while some function calls made by the close UI don't. The liquid-long-client-library knows, but it has no way to convey that information down the stack. So, what we do is try to see if an address is available and use it as the sender if so, and if not fallback to the 0 address.

In the current interface, this will probably work because the close UI doesn't currently support listing positions to close until you are logged in. However, I would like to add the ability to view the website without logging in by supplying an address in the query string, at which point there are a number of calls that will fail (like checking expected payout, which unfortunately requires a valid sender to execute).

epheph commented 5 years ago

I dunno, this doesn't seem THAT hacky... I think you need to level-up your duct-tape 😉