thxprotocol / modules-solidity

Default Asset Pools are connected to an ERC20 contract. The pool is controlled by a permissioned (OAuth2.0) REST API which is responsible for paying the gas costs used to manage the pool. Access to the pool is managed with a flexible role-based access mechanism. Pools can hold various reward configurations for the connected ERC20 tokent contract and will manage the distribution of those token rewards with a withdrawal system. The poll system used to govern the reward configuration and withdrawals is optional.
4 stars 3 forks source link

[HvA] ImmutableFive #34

Closed Netail closed 2 years ago

wooyh2000 commented 2 years ago

I think you don't need to merge into main, but into our own branch. Maybe it is more convenient to create an immutablefive-develop branche

peterpolman commented 2 years ago

@wooyh2000 Nope this is fine! Just keep pushing onto this branch or diverge of this one if your work starts too conflict too much.

Netail commented 2 years ago

I think you don't need to merge into main, but into our own branch. Maybe it is more convenient to create an immutablefive-develop branche

This is our own branch, please leave on draft as it's not even ready

Netail commented 2 years ago

@Netail Lekker busy! Quick pointer: Using expect statements will actually validate if the response of getRewards is as expected. Your tests will currently (probably) all get green checkmarks since there are only console logs and nothing really fails.

Test the response of a call operation:

await expect(contract.connect(addr1).getRewards()).to.eq( 
// expected response
)

Test the response of a send operation (if events are emitted from the contract):

expect(contract.setRewards(addr1.address, [{ token: token.address, amount: 5 }])).to emit(contract, 'ExpectedEventName');

Yup I haven't created valid tests yet, they were for testing purposes for now.

peterpolman commented 2 years ago

Cool cool, just checkin :)

wooyh2000 commented 2 years ago

@Netail Is the PR still a work in progress? And you may want to add comments in your smart-contract and tests to clarify your code more.