OpenZeppelin / OpenZeppelin/compact-contracts
Utilize `recipientTypes` and `ownerTypes` in NonFungibleToken tests
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 55
- Forks
- 29
- Avg merge
- 5d 7h
- Merged PRs (30d)
- 25
Description
This improvement would reduce the boilerplate necessary when testing behavior for a circuit that accepts an Either<ZswapPublicKey, ContractAddress> parameter.
See https://github.com/OpenZeppelin/midnight-contracts/blob/b35b660b83fe7d3a460f7a894198fa23f92d9c18/contracts/fungibleToken/src/test/FungibleToken.test.ts#L36 and https://github.com/OpenZeppelin/midnight-contracts/blob/b35b660b83fe7d3a460f7a894198fa23f92d9c18/contracts/fungibleToken/src/test/FungibleToken.test.ts#L132 as reference
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the referenced FungibleToken.test.ts sections at lines 36 and 132, then find the NonFungibleToken tests and inspect how Either<ZswapPublicKey, ContractAddress> cases are set up. Reuse the recipientTypes and ownerTypes approach where applicable, and consider the work done when the test boilerplate is reduced and the affected tests still pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100