Skip to content

Commit

Permalink
waas: intents test fix (#581)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka authored Sep 27, 2024
1 parent b16e358 commit 95383e6
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/waas/tests/intents.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as chai from 'chai'
import { ethers } from 'ethers'

import { Intent, signIntent } from '../src/intents'
import { IntentDataSendTransaction, IntentDataSignMessage } from '../src/clients/intent.gen'
import { IntentName, IntentDataSendTransaction, IntentDataSignMessage } from '../src/clients/intent.gen'
import { newSECP256K1SessionFromPrivateKey } from '../src/session'
import { getDefaultSecureStoreBackend } from '../src/secure-store'

Expand All @@ -14,7 +14,7 @@ describe('Payloads', () => {
it('Should sign a payload', async () => {
const intent: Intent<IntentDataSendTransaction> = {
version: '1',
name: 'sendTransactions',
name: IntentName.sendTransaction,
issuedAt: 1600000000,
expiresAt: 1600000000 + 86400,
data: {
Expand Down Expand Up @@ -45,14 +45,14 @@ describe('Payloads', () => {
expect(signedIntent.signatures.length).to.equal(1)
expect(signedIntent.signatures[0].sessionId).to.equal(await session.sessionId())
expect(signedIntent.signatures[0].signature).to.equal(
'0x14682ca0eb116109cdf1d0bad6a84e29787787b4a1779d2b43c28d8705ade929267474e8a7725d5e7540ded2010897d3ecaad32b27c75fbfb4f63ff1cf1a948a1c'
'0x0707e5b0a66bc2aa536cd6dfd0ad3f7859ac3a864f9be1d351b450e704b4cf3548b19ffd72f956e1448b0298b862c95489daeb00c0f0686a8c76f22908bf29801b'
)
})

it('Should sign a message payload', async () => {
const intent: Intent<IntentDataSignMessage> = {
version: '1',
name: 'sendTransactions',
name: IntentName.sendTransaction,
issuedAt: 1600000000,
expiresAt: 1600000000 + 86400,
data: {
Expand All @@ -75,14 +75,14 @@ describe('Payloads', () => {
expect(signedIntent.signatures.length).to.equal(1)
expect(signedIntent.signatures[0].sessionId).to.equal(await session.sessionId())
expect(signedIntent.signatures[0].signature).to.equal(
'0x768b25315317e551ed7b540e73fdf69d8816dcc763a50c648cf2966849f089a2495103f06c876c502bfb33cb348c4b77ffe39bbd6483b932b806a5817374f9ea1c'
'0xf21bd58b31a490895c64eec3848465dc89426a208b2a480013e0f779003474d41be802c900c03841a467e6598785e8e7c29b506ff78ec7d08cdccba2be7ecc8c1c'
)
})

it('Should sign transaction payload', async () => {
const intent: Intent<IntentDataSendTransaction> = {
version: '1',
name: 'sendTransactions',
name: IntentName.sendTransaction,
issuedAt: 1600000000,
expiresAt: 1600000000 + 86400,
data: {
Expand Down Expand Up @@ -162,7 +162,7 @@ describe('Payloads', () => {
expect(signedIntent.signatures.length).to.equal(1)
expect(signedIntent.signatures[0].sessionId).to.equal(await session.sessionId())
expect(signedIntent.signatures[0].signature).to.equal(
'0x98dd84b3d4fe077b2f55e2839609b226d8119b9b0ee10756122615a5d68746bf60596069a305a7533123f212b576d16f3f14ad06faed9fc005c32a28bf8bafb21b'
'0xaf0df9a20b7636f7002f082fcfb31dd8959467506ce02351c4d1a53435c7456d5f5cf50564616b26d4d84e91f04a50cd064d693a90777530f16b6e9fb38639181b'
)
})
})

0 comments on commit 95383e6

Please sign in to comment.