Skip to content

Commit

Permalink
fix: Fix signer test
Browse files Browse the repository at this point in the history
  • Loading branch information
janjakubnanista committed Feb 14, 2024
1 parent 2d9914e commit 024000d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/devtools-evm/test/signer/sdk.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('signer/sdk', () => {
const signer = { sendTransaction } as unknown as Signer
const omniSigner = new OmniSignerEVM(transaction.point.eid, signer)

expect(await omniSigner.signAndSend(transaction)).toEqual({ transactionHash: hash })
expect(await omniSigner.signAndSend(transaction)).toEqual({ hash })
expect(sendTransaction).toHaveBeenCalledWith({
to: transaction.point.address,
data: transaction.data,
Expand Down
18 changes: 9 additions & 9 deletions packages/devtools/test/transactions/signer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ describe('transactions/signer', () => {
fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {
// We'll prepare some mock objects for this test
// to mock the transaction responses and receipts
const receipt = { transactionHash: '0x0' }
const receipt = { hash: '0x0' }

// Our successful wait will produce a receipt
const successfulWait = jest.fn().mockResolvedValue(receipt)
const successfulResponse: OmniTransactionResponse = {
transactionHash: '0x0',
hash: '0x0',
wait: successfulWait,
}

Expand Down Expand Up @@ -66,19 +66,19 @@ describe('transactions/signer', () => {
// We'll prepare some mock objects for this test
// to mock the transaction responses and receipts
const error = new Error('Failed transaction')
const receipt = { transactionHash: '0x0' }
const receipt = { hash: '0x0' }

// Our successful wait will produce a receipt
const successfulWait = jest.fn().mockResolvedValue(receipt)
const successfulResponse: OmniTransactionResponse = {
transactionHash: '0x0',
hash: '0x0',
wait: successfulWait,
}

// Our unsuccessful wait will throw an error
const unsuccessfulWait = jest.fn().mockRejectedValue(error)
const unsuccessfulResponse: OmniTransactionResponse = {
transactionHash: '0x0',
hash: '0x0',
wait: unsuccessfulWait,
}

Expand Down Expand Up @@ -127,10 +127,10 @@ describe('transactions/signer', () => {
// We'll prepare some mock objects for this test
// to mock the transaction responses and receipts
const error = new Error('Failed transaction')
const receipt = { transactionHash: '0x0' }
const receipt = { hash: '0x0' }
const successfulWait = jest.fn().mockResolvedValue(receipt)
const successfulResponse: OmniTransactionResponse = {
transactionHash: '0x0',
hash: '0x0',
wait: successfulWait,
}

Expand Down Expand Up @@ -174,12 +174,12 @@ describe('transactions/signer', () => {
fc.asyncProperty(fc.array(transactionArbitrary), async (transactions) => {
// We'll prepare some mock objects for this test
// to mock the transaction responses and receipts
const receipt = { transactionHash: '0x0' }
const receipt = { hash: '0x0' }

// Our successful wait will produce a receipt
const successfulWait = jest.fn().mockResolvedValue(receipt)
const successfulResponse: OmniTransactionResponse = {
transactionHash: '0x0',
hash: '0x0',
wait: successfulWait,
}

Expand Down

0 comments on commit 024000d

Please sign in to comment.