Skip to content

Commit

Permalink
allow custom extra data
Browse files Browse the repository at this point in the history
  • Loading branch information
ZumZoom committed Nov 20, 2024
1 parent 11448df commit 248d9d2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/helpers/orderUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,24 +134,27 @@ function buildFeeTakerExtensions ({
whitelistDiscount = 50,
whitelist = '0x00',
whitelistPostInteraction = whitelist,
customMakingGetter = '0x',
customTakingGetter = '0x',
customPostInteraction = '0x',
}) {
return {
makingAmountData: ethers.solidityPacked(
['address', 'bytes', 'uint16', 'uint16', 'uint8', 'bytes'],
[feeTaker, getterExtraPrefix, integratorFee, resolverFee, whitelistDiscount, whitelist],
['address', 'bytes', 'uint16', 'uint16', 'uint8', 'bytes', 'bytes'],
[feeTaker, getterExtraPrefix, integratorFee, resolverFee, whitelistDiscount, whitelist, customMakingGetter],
),
takingAmountData: ethers.solidityPacked(
['address', 'bytes', 'uint16', 'uint16', 'uint8', 'bytes'],
[feeTaker, getterExtraPrefix, integratorFee, resolverFee, whitelistDiscount, whitelist],
['address', 'bytes', 'uint16', 'uint16', 'uint8', 'bytes', 'bytes'],
[feeTaker, getterExtraPrefix, integratorFee, resolverFee, whitelistDiscount, whitelist, customTakingGetter],
),
postInteraction: ethers.solidityPacked(
['address', 'bytes1', 'address'].concat(
makerReceiver ? ['address'] : [],
['uint16', 'uint16', 'uint8', 'bytes'],
['uint16', 'uint16', 'uint8', 'bytes', 'bytes'],
),
[feeTaker, makerReceiver ? '0x01' : '0x00', feeRecipient].concat(
makerReceiver ? [makerReceiver] : [],
[integratorFee, resolverFee, whitelistDiscount, whitelistPostInteraction],
[integratorFee, resolverFee, whitelistDiscount, whitelistPostInteraction, customPostInteraction],
),
),
};
Expand Down

0 comments on commit 248d9d2

Please sign in to comment.