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

Assorted test improvements 20240701 #1971

Merged
merged 8 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@
* @dev get flow info of a distributor to a pool for given token
* @param token The token used in flow
* @param distributor The sitributor of the flow
* @param pool The GDA pool
* @param pool The GDA pool
* @return lastUpdated Timestamp of flow creation or last flowrate change
* @return flowRate The flow rate
* @return deposit The amount of deposit the flow
Expand Down Expand Up @@ -922,7 +922,7 @@
deposit += cfaDeposit;
owedDeposit += cfaOwedDeposit;
}

{
(uint256 lastUpdatedGDA, int96 gdaNetFlowRate, uint256 gdaDeposit) = gda.getAccountFlowInfo(token, account);

Expand Down Expand Up @@ -964,10 +964,11 @@
function getGDANetFlowInfo(ISuperToken token, address account)
internal
view
returns (uint256 lastUpdated, int96 flowRate, uint256 deposit, uint256 /* owedDeposit unused */)
returns (uint256 lastUpdated, int96 flowRate, uint256 deposit, uint256 owedDeposit)
{
(, IGeneralDistributionAgreementV1 gda) = _getHostAndGDA(token);
(lastUpdated, flowRate, deposit) = gda.getAccountFlowInfo(token, account);
owedDeposit = 0; // unused in GDA

Check warning on line 971 in packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol

View check run for this annotation

Codecov / codecov/patch

packages/ethereum-contracts/contracts/apps/SuperTokenV1Library.sol#L971

Added line #L971 was not covered by tests
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ contract SuperfluidDestructorMock {

fallback() external {
// this == impl in this call
selfdestruct(payable(0));
assembly { selfdestruct(0) }
}

}
8 changes: 5 additions & 3 deletions packages/ethereum-contracts/foundry.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
[profile.default]
root = '../..'
src = 'packages/ethereum-contracts/contracts'
test = 'packages/ethereum-contracts/test/foundry/'
test = 'packages/ethereum-contracts/test/foundry'
solc_version = "0.8.23"
ignored_error_codes = [5159] # selfdestruct in contracts/mocks/SuperfluidDestructorMock.sol
# deny_warnings = true
#deny_warnings = true
ignored_error_codes = [
1699 # assembly { selfdestruct } in contracts/mocks/SuperfluidDestructorMock.sol
]
# keep in sync with truffle-config.js
evm_version = 'paris'
remappings = [
Expand Down
3 changes: 2 additions & 1 deletion packages/ethereum-contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
"/contracts/**/*",
"!/contracts/mocks/*",
"/build/truffle/*.json",
"/build/hardhat/**/*",
"!/build/truffle/*Mock*.json",
"!/build/truffle/*Tester*.json",
"!/build/truffle/*Anvil.json",
"!/build/truffle/*Properties.json",
"/build/hardhat/**/*",
"!/build/hardhat/contracts/mocks/**/*",
"/build/contracts-sizes.txt",
"/build/bundled-abi.js",
"/build/bundled-abi.json",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1606,7 +1606,6 @@ contract FoundrySuperfluidTester is Test {

PoolUnitData memory poolUnitDataBefore = _helperGetPoolUnitsData(pool_);

(int256 claimableBalance,) = pool_.getClaimableNow(member_);
(int256 balanceBefore,,,) = poolSuperToken.realtimeBalanceOfNow(member_);
{
_updateMemberUnits(pool_, poolSuperToken, caller_, member_, newUnits_, useBools_);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -559,9 +559,9 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste
for (uint256 i = 0; i < members.length; ++i) {
if (sf.gda.isPool(superToken, members[i]) || members[i] == address(0)) continue;

uint128 memberUnits = pool.getUnits(members[i]);
uint128 memberIUnits = pool.getUnits(members[i]);

assertEq(perUnitDistributionAmount * memberUnits, pool.getTotalAmountReceivedByMember(members[i]));
assertEq(perUnitDistributionAmount * memberIUnits, pool.getTotalAmountReceivedByMember(members[i]));
}
}

Expand Down Expand Up @@ -594,9 +594,9 @@ contract GeneralDistributionAgreementV1IntegrationTest is FoundrySuperfluidTeste
for (uint256 i = 0; i < members.length; ++i) {
if (sf.gda.isPool(superToken, members[i]) || members[i] == address(0)) continue;

uint128 memberUnits = pool.getUnits(members[i]);
uint128 memberIUnits = pool.getUnits(members[i]);

assertEq(perUnitDistributionAmount * memberUnits, pool.getTotalAmountReceivedByMember(members[i]));
assertEq(perUnitDistributionAmount * memberIUnits, pool.getTotalAmountReceivedByMember(members[i]));
}
}

Expand Down
Loading