Skip to content

Commit

Permalink
fix: enable post interaction (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrvk authored Mar 18, 2024
1 parent 1692c5b commit 691022f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/fusion-order/fusion-order.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('Fusion Order', () => {
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
takingAmount: '1420000000',
makerTraits:
'29852648006495581632639394572552351243421169944806257724550573036760110989312',
'33471150795161712739625987854073848363835856965607525350783622537007396290560',
salt: '14969955465678758833706505435513058355190519874774'
})

Expand Down
1 change: 1 addition & 0 deletions src/fusion-order/fusion-order.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export class FusionOrder {
.withExpiration(deadline)
.setPartialFills(allowPartialFills)
.setMultipleFills(allowMultipleFills)
.enablePostInteraction()

if (makerTraits.isBitInvalidatorMode()) {
assert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {SettlementPostInteractionData} from './settlement-post-interaction-data'
import {bpsToRatioFormat} from '../../sdk/utils'

describe('SettlementPostInteractionData', () => {
it('Should encode/decode with no fees and whitelist', () => {
it('Should encode/decode with bank fee and whitelist', () => {
const data = SettlementPostInteractionData.new({
bankFee: 1n,
resolvingStartTime: 1708117482n,
Expand All @@ -24,6 +24,24 @@ describe('SettlementPostInteractionData', () => {
)
})

it('Should encode/decode with no fees and whitelist', () => {
const data = SettlementPostInteractionData.new({
resolvingStartTime: 1708117482n,
whitelist: [
{
address: Address.ZERO_ADDRESS,
allowFrom: 0n
}
]
})

const encoded = data.encode()

expect(getBytesCount(encoded)).toEqual(17n)
expect(SettlementPostInteractionData.decode(encoded)).toStrictEqual(
data
)
})
it('Should encode/decode with fees and whitelist', () => {
const data = SettlementPostInteractionData.new({
bankFee: 0n,
Expand Down

0 comments on commit 691022f

Please sign in to comment.