Skip to content
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

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

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

vivekjain23
Copy link

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.

  • I have followed the contribution guidelines for this project
  • I have performed a self-review of my own code
  • I have selected the develop branch as the target branch
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that new and existing unit tests pass locally with my changes

@vivekjain23 vivekjain23 changed the title Add solo test for getAllowance contract Docs/move getAllowance.sol from wiki Jul 9, 2024
Copy link
Contributor

@salaheldinsoliman salaheldinsoliman left a comment

Choose a reason for hiding this comment

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

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.

@vivekjain23
Copy link
Author

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
Copy link
Contributor

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
Copy link
Contributor

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

@vivekjain23 vivekjain23 changed the title Docs/move getAllowance.sol from wiki feat(docs): move getAllowance.sol smart contract example from wiki to wasp Jul 29, 2024
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