Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions integration/tests/challenge_channel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ import { Identity } from '@/identity';
import { TestNitroliteClient } from '@/nitroliteClient';
import { CONFIG } from '@/setup';
import { getChannelUpdatePredicateWithStatus, TestWebSocket } from '@/ws';
import {
parseChannelUpdateResponse,
RPCChannelStatus,
} from '@erc7824/nitrolite';
import { parseChannelUpdateResponse, RPCChannelStatus } from '@erc7824/nitrolite';
import { parseUnits } from 'viem';

describe('Challenge channel', () => {
Expand Down Expand Up @@ -53,6 +50,12 @@ describe('Challenge channel', () => {
const channelId = createResponse.channelId;
expect(createResponse.version).toBe(1); // 1 because channel was resized as well

const challengedChannelUpdatePromise = ws.waitForMessage(
getChannelUpdatePredicateWithStatus(RPCChannelStatus.Challenged),
undefined,
5000
);

const challengeReceipt = await client.challengeChannel({
channelId: channelId,
candidateState: {
Expand All @@ -66,11 +69,6 @@ describe('Challenge channel', () => {

expect(challengeReceipt).toBeDefined();

const challengedChannelUpdatePromise = ws.waitForMessage(
getChannelUpdatePredicateWithStatus(RPCChannelStatus.Challenged),
5000
);

const challengeConfirmation = await blockUtils.waitForTransaction(challengeReceipt);
expect(challengeConfirmation).toBeDefined();

Expand Down
78 changes: 78 additions & 0 deletions sdk/src/abis/aa/execute.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
export const AAExecuteAbi = [
{
inputs: [
{
internalType: 'address',
name: 'to',
type: 'address',
},
{
internalType: 'uint256',
name: 'value',
type: 'uint256',
},
{
internalType: 'bytes',
name: 'data',
type: 'bytes',
},
{
internalType: 'enum Operation',
name: '',
type: 'uint8',
},
],
name: 'execute',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
components: [
{
internalType: 'address',
name: 'to',
type: 'address',
},
{
internalType: 'uint256',
name: 'value',
type: 'uint256',
},
{
internalType: 'bytes',
name: 'data',
type: 'bytes',
},
],
internalType: 'struct Call[]',
name: 'calls',
type: 'tuple[]',
},
],
name: 'executeBatch',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{
internalType: 'address',
name: 'to',
type: 'address',
},
{
internalType: 'bytes',
name: 'data',
type: 'bytes',
},
],
name: 'executeDelegateCall',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
];
51 changes: 51 additions & 0 deletions sdk/src/abis/aa/user_op_event.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { AbiEvent } from 'viem';

export const UserOpEventAbi: AbiEvent = {
anonymous: false,
inputs: [
{
indexed: true,
internalType: 'bytes32',
name: 'userOpHash',
type: 'bytes32',
},
{
indexed: true,
internalType: 'address',
name: 'sender',
type: 'address',
},
{
indexed: true,
internalType: 'address',
name: 'paymaster',
type: 'address',
},
{
indexed: false,
internalType: 'uint256',
name: 'nonce',
type: 'uint256',
},
{
indexed: false,
internalType: 'bool',
name: 'success',
type: 'bool',
},
{
indexed: false,
internalType: 'uint256',
name: 'actualGasCost',
type: 'uint256',
},
{
indexed: false,
internalType: 'uint256',
name: 'actualGasUsed',
type: 'uint256',
},
],
name: 'UserOperationEvent',
type: 'event',
};
Loading
Loading