Skip to content

Conversation

@degen-dhow
Copy link
Member

@degen-dhow degen-dhow commented May 13, 2022

Early, early draft for getting feedback on why Reach frontend is behaving the way it is. Mostly bad code, ignore.

// returns info
console.log(t1,t2,p);
// nothing happens
return true;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good example here, Buyer can acc swap, console does print NFT ID, ASA ID, and Price in ASA but nothing happens at return true but accSwap signature is accSwap: Fun([Token, Token, UInt], Bool),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got some advice from Nick to double check:

  1. no need to use await on line 61
  2. Line 62: also don't think you need the await here, can get the user stuck in the front end. He suggested using the backend.Buyer syntax as well, didn't think that the current syntax would work... backend.Buyer(c, {put interact object here});

Copy link

@evanmaltz evanmaltz May 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to use the new syntax, I think it should be: c.p.Buyer({interact object}) with no await. The way it is now you make a copy of the contract handle (e.g. acct2.contract(backend, c.getInfo())). The c.getInfo() might need an await, but that whole part is unnecessary and would just reference you contract handle c

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two other points:

  1. Interact object is missing methods, such as cancel
  2. The reach compiler and stdlib have different versions, use version 0.1.10-rc.4

@degen-dhow degen-dhow changed the title reach stuff Draft: Adds a Reach contract, Sell NFT for Degen (or other ASAs) May 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants