Skip to content

Commit

Permalink
fix: signTransaction tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbrugneaux committed Oct 31, 2023
1 parent 27c1794 commit bd6e922
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions src/actions/wallet/signTransaction.test.ts
Expand Up @@ -343,7 +343,7 @@ describe('legacy', () => {
})
})

describe('custom (cip42)', () => {
describe('custom (cip64)', () => {
const walletClient = createWalletClient({
chain: celo,
transport: http(localHttpUrl),
Expand All @@ -358,10 +358,33 @@ describe('custom (cip42)', () => {
feeCurrency: '0x765de816845861e75a25fca122bb6898b8b1282a',
maxFeePerGas: parseGwei('20'),
maxPriorityFeePerGas: parseGwei('2'),
}),
).toMatchInlineSnapshot(
'"0x7bf86e0182031184773594008504a817c800825208808080c094765de816845861e75a25fca122bb6898b8b1282a01a0ea3e86b0fd53ada619406822e96cf0dcec1e73b7a8bba60ad355fc8a8f4780e0a0399581f2dbfacab4d301a42e8773f6db217630e861b7d56ccbd333d553a6bb9c"',
)
})
})

describe('custom (cip42)', () => {
const walletClient = createWalletClient({
chain: celo,
transport: http(localHttpUrl),
})

test('default', async () => {
expect(
await signTransaction(walletClient, {
account: privateKeyToAccount(sourceAccount.privateKey),
chain: null,
...base,
feeCurrency: '0x765de816845861e75a25fca122bb6898b8b1282a',
maxFeePerGas: parseGwei('20'),
gatewayFee: 4n,
gatewayFeeRecipient: '0x0f16e9b0d03470827a95cdfd0cb8a8a3b46969b9',
type: 'cip42',
}),
).toMatchInlineSnapshot(
'"0x7cf8700182031184773594008504a817c80082520894765de816845861e75a25fca122bb6898b8b1282a8080808080c080a05076fb030517e3243dd38850c21923f4343ed429db3ab032178f2d8702cad17fa07e860ca7bc7c2f34ece898c3e6912dcef4608ad3fc0b76bf0d760dcb608a71b2"',
'"0x7cf88001820311808504a817c80082520894765de816845861e75a25fca122bb6898b8b1282a940f16e9b0d03470827a95cdfd0cb8a8a3b46969b904808080c080a0581c45f4daab2b9c3b364e6b1c009405f8922bb44f9d6c63b0625841a9939c25a027156582098218be4a7996406934cf612d70f2a2c6b7a1d66e00a969bc7071d0"',
)
})
})
Expand Down

0 comments on commit bd6e922

Please sign in to comment.