Skip to content

Commit

Permalink
set accounting context before scheduling rulesets
Browse files Browse the repository at this point in the history
  • Loading branch information
mejango committed Jul 8, 2024
1 parent dd5d1d8 commit ddbc054
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 19 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bananapus/core",
"version": "0.0.19",
"version": "0.0.20",
"license": "MIT",
"repository": {
"type": "git",
Expand Down
12 changes: 6 additions & 6 deletions src/JBController.sol
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,12 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
// Set this contract as the project's controller in the directory.
DIRECTORY.setControllerOf(projectId, IERC165(this));

// Queue the rulesets.
uint256 rulesetId = _queueRulesets(projectId, rulesetConfigurations);

// Configure the terminals.
_configureTerminals(projectId, terminalConfigurations);

// Queue the rulesets.
uint256 rulesetId = _queueRulesets(projectId, rulesetConfigurations);

emit LaunchProject(rulesetId, projectId, projectUri, memo, _msgSender());
}

Expand Down Expand Up @@ -374,12 +374,12 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
// Set this contract as the project's controller in the directory.
DIRECTORY.setControllerOf(projectId, IERC165(this));

// Queue the first ruleset.
rulesetId = _queueRulesets(projectId, rulesetConfigurations);

// Configure the terminals.
_configureTerminals(projectId, terminalConfigurations);

// Queue the first ruleset.
rulesetId = _queueRulesets(projectId, rulesetConfigurations);

emit LaunchRulesets(rulesetId, projectId, memo, _msgSender());
}

Expand Down
1 change: 0 additions & 1 deletion test/TestLaunchProject.sol
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ contract TestLaunchProject_Local is TestBaseWorkflow {
decimals: 18,
currency: uint32(uint160(JBConstants.NATIVE_TOKEN))
});
new JBAccountingContext[](1);
_terminalConfigurations[0] =
JBTerminalConfig({terminal: _terminal, accountingContextsToAccept: _tokensToAccept});

Expand Down
2 changes: 1 addition & 1 deletion test/TestMetadataParserLib.sol
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,6 @@ contract JBDelegateMetadataLib_Test_Local is Test {

// New revert to help integrators.
vm.expectRevert(abi.encodeWithSignature("DATA_NOT_PADDED()"));
bytes memory _metadata = parser.createMetadata(_ids, _datas);
parser.createMetadata(_ids, _datas);
}
}
1 change: 0 additions & 1 deletion test/TestMintTokensOf.sol
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ contract TestMintTokensOf_Local is TestBaseWorkflow {
decimals: 18,
currency: uint32(uint160(JBConstants.NATIVE_TOKEN))
});
new JBAccountingContext[](1);
_terminalConfigurations[0] =
JBTerminalConfig({terminal: _terminal, accountingContextsToAccept: _tokensToAccept});

Expand Down
9 changes: 2 additions & 7 deletions test/TestMultipleAccessLimits.sol
Original file line number Diff line number Diff line change
Expand Up @@ -260,18 +260,13 @@ contract TestMultipleAccessLimits_Local is TestBaseWorkflow {

_projectOwner = multisig();

JBTerminalConfig[] memory _terminalConfigurations = new JBTerminalConfig[](2);
JBAccountingContext[] memory _tokensToAccept = new JBAccountingContext[](2);
JBTerminalConfig[] memory _terminalConfigurations = new JBTerminalConfig[](1);
JBAccountingContext[] memory _tokensToAccept = new JBAccountingContext[](1);
_tokensToAccept[0] = JBAccountingContext({
token: JBConstants.NATIVE_TOKEN,
decimals: 18,
currency: uint32(uint160(JBConstants.NATIVE_TOKEN))
});
_tokensToAccept[1] = JBAccountingContext({
token: address(usdcToken()),
decimals: 6,
currency: uint32(uint160(address(usdcToken())))
});
_terminalConfigurations[0] =
JBTerminalConfig({terminal: __terminal, accountingContextsToAccept: _tokensToAccept});

Expand Down

0 comments on commit ddbc054

Please sign in to comment.