Skip to content

Commit

Permalink
Fix relay-kit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniSomoza committed Oct 11, 2023
1 parent 0e389e5 commit 96c8a5a
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions packages/relay-kit/src/packs/gelato/GelatoRelayPack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('GelatoRelayPack', () => {

expect(estimation).toBe(FEE_ESTIMATION.toString())
expect(mockGetEstimateFee).toHaveBeenCalledWith(
chainId,
BigInt(chainId),
GELATO_NATIVE_TOKEN_ADDRESS,
BigInt(gasLimit),
false
Expand All @@ -138,7 +138,7 @@ describe('GelatoRelayPack', () => {
expect(response).toBe(RELAY_RESPONSE)
expect(mockSponsoredCall).toHaveBeenCalledWith(
{
chainId: CHAIN_ID,
chainId: BigInt(CHAIN_ID),
target: SAFE_ADDRESS,
data: '0x'
},
Expand Down Expand Up @@ -173,6 +173,7 @@ describe('GelatoRelayPack', () => {
jest.clearAllMocks()
relayPack = new GelatoRelayPack()
safe.getNonce = jest.fn().mockResolvedValue(0)
safe.getChainId = jest.fn().mockResolvedValue(0)
safe.getContractManager = jest.fn().mockReturnValue({ safeContract: {} })
safe.createTransaction = jest.fn().mockResolvedValue(SAFE_TRANSACTION)
mockedIsGasTokenCompatibleWithHandlePayment.mockResolvedValue(Promise.resolve(true))
Expand Down Expand Up @@ -279,6 +280,7 @@ describe('GelatoRelayPack', () => {
jest.clearAllMocks()
relayPack = new GelatoRelayPack()
safe.getNonce = jest.fn().mockResolvedValue(0)
safe.getChainId = jest.fn().mockResolvedValue(0)
safe.getContractManager = jest.fn().mockReturnValue({ safeContract: {} })
safe.createTransaction = jest.fn().mockResolvedValue(SAFE_TRANSACTION)
mockedIsGasTokenCompatibleWithHandlePayment.mockResolvedValue(Promise.resolve(true))
Expand Down Expand Up @@ -387,14 +389,14 @@ describe('GelatoRelayPack', () => {
expect(response).toBe(RELAY_RESPONSE)
expect(mockCallWithSyncFee).toHaveBeenCalledWith(
{
chainId: CHAIN_ID,
chainId: BigInt(CHAIN_ID),
target: SAFE_ADDRESS,
data: '0x',
feeToken: GELATO_NATIVE_TOKEN_ADDRESS,
isRelayContext: false
},
{
gasLimit: '100000'
gasLimit: BigInt(100_000)
}
)
})
Expand All @@ -413,7 +415,7 @@ describe('GelatoRelayPack', () => {
expect(sponsoredResponse).toBe(RELAY_RESPONSE)
expect(mockSponsoredCall).toHaveBeenCalledWith(
{
chainId: CHAIN_ID,
chainId: BigInt(CHAIN_ID),
target: SAFE_ADDRESS,
data: '0x'
},
Expand All @@ -433,14 +435,14 @@ describe('GelatoRelayPack', () => {
expect(paidResponse).toBe(RELAY_RESPONSE)
expect(mockCallWithSyncFee).toHaveBeenCalledWith(
{
chainId: CHAIN_ID,
chainId: BigInt(CHAIN_ID),
target: SAFE_ADDRESS,
data: '0x',
feeToken: GELATO_NATIVE_TOKEN_ADDRESS,
isRelayContext: false
},
{
gasLimit: '100000'
gasLimit: BigInt(100_000)
}
)
})
Expand Down Expand Up @@ -495,7 +497,7 @@ describe('GelatoRelayPack', () => {
expect(gelatoResponse).toBe(RELAY_RESPONSE)
expect(mockSponsoredCall).toHaveBeenCalledWith(
{
chainId: CHAIN_ID,
chainId: BigInt(CHAIN_ID),
target: SAFE_ADDRESS,
data: ENCODED_TRANSACTION_DATA
},
Expand Down Expand Up @@ -529,7 +531,7 @@ describe('GelatoRelayPack', () => {
expect(gelatoResponse).toBe(RELAY_RESPONSE)
expect(mockCallWithSyncFee).toHaveBeenCalledWith(
{
chainId: CHAIN_ID,
chainId: BigInt(CHAIN_ID),
target: SAFE_ADDRESS,
data: ENCODED_TRANSACTION_DATA,
feeToken: GAS_TOKEN,
Expand Down Expand Up @@ -569,7 +571,7 @@ describe('GelatoRelayPack', () => {
expect(gelatoResponse).toBe(RELAY_RESPONSE)
expect(mockSponsoredCall).toHaveBeenCalledWith(
{
chainId: CHAIN_ID,
chainId: BigInt(CHAIN_ID),
target: MULTISEND_ADDRESS, // multiSend contract as a target address because a counterfactual deployment is present
data: SAFE_DEPLOYMENT_BATCH.data
},
Expand Down Expand Up @@ -606,7 +608,7 @@ describe('GelatoRelayPack', () => {
expect(gelatoResponse).toBe(RELAY_RESPONSE)
expect(mockCallWithSyncFee).toHaveBeenCalledWith(
{
chainId: CHAIN_ID,
chainId: BigInt(CHAIN_ID),
target: MULTISEND_ADDRESS, // multiSend contract as a target address because a counterfactual deployment is present
data: SAFE_DEPLOYMENT_BATCH.data,
feeToken: GAS_TOKEN,
Expand Down

0 comments on commit 96c8a5a

Please sign in to comment.