Skip to content

Commit

Permalink
clean up encodeWithAccountCounter interface
Browse files Browse the repository at this point in the history
  • Loading branch information
androolloyd committed Oct 9, 2023
1 parent 5cbf80e commit 162b508
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/originators/Originator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ abstract contract Originator is Ownable {
}

// Encode the data with the account's nonce for generating a signature
function encodeWithAccountCounter(address account, bytes32 contextHash)
function encodeWithAccountCounter(bytes32 contextHash)
public
view
virtual
Expand Down Expand Up @@ -214,7 +214,7 @@ abstract contract Originator is Ownable {
function _validateOffer(Request calldata request, Details memory details) internal virtual {
bytes32 contextHash = keccak256(request.details);
_validateSignature(
keccak256(encodeWithAccountCounter(strategist, keccak256(request.details))), request.approval
keccak256(encodeWithAccountCounter(keccak256(request.details))), request.approval
);
if (request.custodian != details.custodian) {
revert InvalidCustodian();
Expand Down
4 changes: 2 additions & 2 deletions test/StarPortTest.sol
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ contract StarPortTest is BaseOrderTest {
bool isTrusted = loanData.caveats.length == 0;
{
bytes32 detailsHash =
keccak256(originator.encodeWithAccountCounter(strategist.addr, keccak256(loanData.details)));
keccak256(originator.encodeWithAccountCounter(keccak256(loanData.details)));
(uint8 v, bytes32 r, bytes32 s) = vm.sign(strategist.key, detailsHash);
LoanManager.Loan memory loan = LoanManager.Loan({
custodian: address(loanData.custodian),
Expand Down Expand Up @@ -262,7 +262,7 @@ contract StarPortTest is BaseOrderTest {
ConsiderationItem[] storage collateral
) internal {
(uint8 v, bytes32 r, bytes32 s) = vm.sign(
strategist.key, keccak256(originator.encodeWithAccountCounter(strategist.addr, keccak256(loanData.details)))
strategist.key, keccak256(originator.encodeWithAccountCounter(keccak256(loanData.details)))
);

LoanManager.Loan memory loan = LoanManager.Loan({
Expand Down

0 comments on commit 162b508

Please sign in to comment.