Skip to content

Commit

Permalink
Centrifuge App: fix empty hash (#1828)
Browse files Browse the repository at this point in the history
* Use ethers HashZero to represent empty bytes

* Format zero bytes

* Fix hashes

* Undo types
  • Loading branch information
sophialittlejohn authored Dec 20, 2023
1 parent 9debe0b commit b6a2a8d
Showing 1 changed file with 6 additions and 16 deletions.
22 changes: 6 additions & 16 deletions centrifuge-js/src/modules/liquidityPools.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { BigNumber } from '@ethersproject/bignumber'
import { Contract, ContractInterface } from '@ethersproject/contracts'
import type { JsonRpcProvider, TransactionRequest, TransactionResponse } from '@ethersproject/providers'
import { formatBytes32String } from '@ethersproject/strings'
import BN from 'bn.js'
import { signERC2612Permit } from 'eth-permit'
import { combineLatestWith, firstValueFrom, from, map, startWith, switchMap } from 'rxjs'
Expand Down Expand Up @@ -141,7 +140,7 @@ export function getLiquidityPoolsModule(inst: Centrifuge) {
const [lpAddress, order] = args
const user = inst.getSignerAddress('evm')
return pending(
contract(lpAddress, ABI.LiquidityPool).requestDeposit(order.toString(), user, user, formatBytes32String(''), {
contract(lpAddress, ABI.LiquidityPool).requestDeposit(order.toString(), user, user, [], {
...options,
gasLimit: 300000,
})
Expand All @@ -152,7 +151,7 @@ export function getLiquidityPoolsModule(inst: Centrifuge) {
const [lpAddress, order] = args
const user = inst.getSignerAddress('evm')
return pending(
contract(lpAddress, ABI.LiquidityPool).requestRedeem(order.toString(), user, user, formatBytes32String(''), {
contract(lpAddress, ABI.LiquidityPool).requestRedeem(order.toString(), user, user, [], {
...options,
gasLimit: 300000,
})
Expand All @@ -166,19 +165,10 @@ export function getLiquidityPoolsModule(inst: Centrifuge) {
const [lpAddress, order, { deadline, r, s, v }] = args
const user = inst.getSignerAddress('evm')
return pending(
contract(lpAddress, ABI.LiquidityPool).requestDepositWithPermit(
order.toString(),
user,
formatBytes32String(''),
deadline,
v,
r,
s,
{
...options,
gasLimit: 300000,
}
)
contract(lpAddress, ABI.LiquidityPool).requestDepositWithPermit(order.toString(), user, [], deadline, v, r, s, {
...options,
gasLimit: 300000,
})
)
}

Expand Down

0 comments on commit b6a2a8d

Please sign in to comment.