iotaledger / wasp

Node for IOTA Smart Contracts
Apache License 2.0
289 stars 147 forks source link

feat(docs): move getAllowance.sol smart contract example from wiki to wasp #3463

Open vivekjain23 opened 1 month ago

vivekjain23 commented 1 month ago

Description of change

This is the PR addressing moving Wiki contracts to the wasp repo. A GetAllowance.sol contract was added, alongside a solo test for it.

Type of change

fixes issue: #1613

How the change has been tested

A Solo test.

Make sure to provide instructions for the maintainer as well as any relevant configurations.

Change checklist

Tick the boxes that are relevant to your changes, and delete any items that are not.

vivekjain23 commented 1 month ago

isc.allow()

To make the test more meaningful, I think a call to isc.allow() is to be made before getAllowanceFrom, Then check if they are equal.

Yes, you are right. I have tried finding the isc.allow() or similar methods, but I was unable to find them. Please guide me regarding the same if possible.

salaheldinsoliman commented 1 month ago

isc.allow()

To make the test more meaningful, I think a call to isc.allow() is to be made before getAllowanceFrom, Then check if they are equal.

Yes, you are right. I have tried finding the isc.allow() or similar methods, but I was unable to find them. Please guide me regarding the same if possible.

You can create a separate function in the contract, then call isc.allow() before getAllowanceFrom(). Here is an example: https://wiki.iota.org/isc/how-tos/core-contracts/basics/allowance/allow/

lucas-tortora commented 1 month ago

could you rename the PR to follow the guidelines on confluence?