Skip to content

Commit

Permalink
fix: adjusting call stack
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminLu committed Sep 14, 2023
1 parent 2b2b652 commit 9980b10
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/pmm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ describe('PMM NewOrder', function () {
)
})
it('should sign pmmv5 order by EOA', async function () {
const marketMakingInfo = getMarketMakingInfo()
replaceMarketMakingAddress(chainId, signer.address, updaterStack)
const marketMakingInfo = getMarketMakingInfo()
const userAddr = Wallet.createRandom().address.toLowerCase()
const order = await callNewOrder({
chainId: chainId,
Expand Down Expand Up @@ -99,13 +99,13 @@ describe('PMM NewOrder', function () {
expect(recovered.toLowerCase()).eq(signer.address.toLowerCase())
})
it('should sign pmmv5 order for MMPv4', async function () {
const marketMakingInfo = getMarketMakingInfo()
const usdtHolder = await ethers.provider.getSigner(usdtHolders[chainId])
const usdt = await ethers.getContractAt(ABI.IERC20, USDT_ADDRESS[chainId])
const mmpSigner = Wallet.createRandom()
const [deployer] = await ethers.getSigners()
const mmproxy = await deployMMPV4Wallet(mmpSigner, deployer)
replaceMarketMakingAddress(chainId, mmproxy.address, updaterStack)
const marketMakingInfo = getMarketMakingInfo()
await usdt.connect(usdtHolder).transfer(mmproxy.address, ethers.utils.parseUnits('1000', 6))
const userAddr = Wallet.createRandom().address.toLowerCase()
const order = await callNewOrder({
Expand Down
8 changes: 4 additions & 4 deletions test/rfqv1.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ describe('RFQV1 NewOrder', function () {
init(chainId, signer)
})
it('should sign rfqv1 order by EIP712', async function () {
const marketMakingInfo = getMarketMakingInfo()
replaceMarketMakingAddress(chainId, signer.address, updaterStack)
const marketMakingInfo = getMarketMakingInfo()
const userAddr = Wallet.createRandom().address.toLowerCase()
const order = await callNewOrder({
chainId: chainId,
Expand Down Expand Up @@ -90,7 +90,6 @@ describe('RFQV1 NewOrder', function () {
expect(Number(order.expirationTimeSeconds)).gt(0)
})
it('should sign rfqv1 order for MMPv4', async () => {
const marketMakingInfo = getMarketMakingInfo()
const user = Wallet.createRandom()
const userAddr = user.address.toLowerCase()
const [deployer] = await ethers.getSigners()
Expand All @@ -100,6 +99,7 @@ describe('RFQV1 NewOrder', function () {
console.log(`mmproxy: ${mmproxy.address}`)
expect(mmproxy.address).is.not.null
replaceMarketMakingAddress(chainId, mmproxy.address, updaterStack)
const marketMakingInfo = getMarketMakingInfo()
const order = await callNewOrder({
base: 'ETH',
quote: 'USDT',
Expand Down Expand Up @@ -141,7 +141,6 @@ describe('RFQV1 NewOrder', function () {
expect(isValid).true
}).timeout(360000)
it('should sign rfqv1 order for a ERC1271_EIP712_EIP191 MMP contract', async () => {
const marketMakingInfo = getMarketMakingInfo()
const [deployer] = await ethers.getSigners()
const privateKey = crypto.randomBytes(32)
const user = new ethers.Wallet(privateKey, ethers.provider)
Expand All @@ -151,6 +150,7 @@ describe('RFQV1 NewOrder', function () {
const walletContract = await deployEIP1271Plus191Wallet(allowSigner, deployer)
expect(walletContract.address).is.not.null
replaceMarketMakingAddress(chainId, walletContract.address, updaterStack)
const marketMakingInfo = getMarketMakingInfo()
const order = await callNewOrder({
base: 'ETH',
quote: 'USDT',
Expand Down Expand Up @@ -192,7 +192,6 @@ describe('RFQV1 NewOrder', function () {
expect(isValid).true
}).timeout(360000)
it('should sign rfqv1 order for a ERC1271_EIP712 MMP contract', async () => {
const marketMakingInfo = getMarketMakingInfo()
const [deployer] = await ethers.getSigners()
const user = Wallet.createRandom()
const userAddr = user.address.toLowerCase()
Expand All @@ -201,6 +200,7 @@ describe('RFQV1 NewOrder', function () {
const walletContract = await deployERC1271Wallet(allowSigner, deployer)
expect(walletContract.address).is.not.null
replaceMarketMakingAddress(chainId, walletContract.address, updaterStack)
const marketMakingInfo = getMarketMakingInfo()
const order = await callNewOrder({
base: 'ETH',
quote: 'USDT',
Expand Down

0 comments on commit 9980b10

Please sign in to comment.