Skip to content

Commit

Permalink
fix: do not mutate Immutables (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrvk authored Aug 12, 2024
1 parent 80d30ff commit 6742e9a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/immutables/immutables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,13 @@ export class Immutables {
return Immutables.new({...this, ...dstComplement})
}

public withDeployedAt(time: bigint): this {
this.timeLocks.setDeployedAt(time)

return this
public withDeployedAt(time: bigint): Immutables {
return Immutables.new({
...this,
timeLocks: TimeLocks.fromBigInt(
this.timeLocks.build()
).setDeployedAt(time)
})
}

public withTaker(taker: Address): Immutables {
Expand Down

0 comments on commit 6742e9a

Please sign in to comment.