porter-finance / v1-core

⛰️ Smart contracts powering the Porter protocol.
https://porter.finance
GNU Affero General Public License v3.0
4 stars 3 forks source link

Add Tests From Bond Holder's Perspective #303

Closed Namaskar-1F64F closed 2 years ago

Namaskar-1F64F commented 2 years ago

Where it makes sense, the bondHolder signer should be used instead of the issuer. By default the issuer signs transactions within the test. .connect(bondHolder) uses the bond holder's address to perform actions. To get this to work in most places, the issuer must transfer tokens to the bond holder and then the bond holder can perform the actions.

In addition to this, I found a bug in the expecting token balance changes. Because there was no await on the function, the tests were false positives. This uncovered a problem with how we were handling decimals in the test config max supply (18 decimals for all of them).

These configs are now also dynamically made in the fixture.

closes #294