Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
"tar": ">=7.5.16",
"tar-fs@>=3.0.0 <3.1.1": ">=3.1.1",
"tmp": ">=0.2.7",
"undici@>=7.0.0 <7.24.0": "7.24.0",
"undici@>=7.0.0 <7.28.0": "7.28.0",
"vite@>=6.0.0 <=6.4.2": "6.4.3",
"vite@>=7.0.0 <=7.3.1": "7.3.2",
"vite@>=8.0.0 <=8.0.15": "8.0.16",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 21 additions & 33 deletions src/actions/public/getProof.test.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
import { expect, test } from 'vitest'

import { base } from '../../chains/index.js'
import { createPublicClient } from '../../clients/createPublicClient.js'
import { http } from '../../clients/transports/http.js'
import { wagmiContractConfig } from '~test/abis.js'
import { anvilMainnet } from '~test/anvil.js'
import type { Hash } from '../../types/misc.js'
import { getBlock } from './getBlock.js'
import { getProof } from './getProof.js'

test('default', async () => {
const client = createPublicClient({
chain: base,
transport: http(),
})
const client = anvilMainnet.getClient()
const storageKeys: Hash[] = [
'0x0000000000000000000000000000000000000000000000000000000000000000',
]

test('default', async () => {
const result = await getProof(client, {
address: '0x4200000000000000000000000000000000000016',
storageKeys: [
'0x4a932049252365b3eedbc5190e18949f2ec11f39d3bef2d259764799a1b27d99',
],
address: wagmiContractConfig.address,
storageKeys,
})

expect(Object.keys(result)).toMatchInlineSnapshot(`
expect(Object.keys(result).sort()).toMatchInlineSnapshot(`
[
"accountProof",
"address",
Expand All @@ -33,22 +31,17 @@ test('default', async () => {
})

test('args: blockHash (EIP-1898)', async () => {
const client = createPublicClient({
chain: base,
transport: http(),
const block = await getBlock(client, {
blockNumber: anvilMainnet.forkBlockNumber,
})

const block = await getBlock(client, { blockTag: 'latest' })

const result = await getProof(client, {
address: '0x4200000000000000000000000000000000000016',
storageKeys: [
'0x4a932049252365b3eedbc5190e18949f2ec11f39d3bef2d259764799a1b27d99',
],
address: wagmiContractConfig.address,
storageKeys,
blockHash: block.hash!,
})

expect(Object.keys(result)).toMatchInlineSnapshot(`
expect(Object.keys(result).sort()).toMatchInlineSnapshot(`
[
"accountProof",
"address",
Expand All @@ -62,23 +55,18 @@ test('args: blockHash (EIP-1898)', async () => {
})

test('args: blockHash + requireCanonical (EIP-1898)', async () => {
const client = createPublicClient({
chain: base,
transport: http(),
const block = await getBlock(client, {
blockNumber: anvilMainnet.forkBlockNumber,
})

const block = await getBlock(client, { blockTag: 'latest' })

const result = await getProof(client, {
address: '0x4200000000000000000000000000000000000016',
storageKeys: [
'0x4a932049252365b3eedbc5190e18949f2ec11f39d3bef2d259764799a1b27d99',
],
address: wagmiContractConfig.address,
storageKeys,
blockHash: block.hash!,
requireCanonical: true,
})

expect(Object.keys(result)).toMatchInlineSnapshot(`
expect(Object.keys(result).sort()).toMatchInlineSnapshot(`
[
"accountProof",
"address",
Expand Down
12 changes: 2 additions & 10 deletions src/clients/decorators/public.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@ import {
writeContract,
} from '../../actions/index.js'
import { getBlockNumber } from '../../actions/public/getBlockNumber.js'
import { base } from '../../chains/index.js'
import { pad } from '../../utils/index.js'
import { createSiweMessage } from '../../utils/siwe/createSiweMessage.js'
import { parseEther } from '../../utils/unit/parseEther.js'
import { wait } from '../../utils/wait.js'
import { createPublicClient } from '../createPublicClient.js'
import { http } from '../transports/http.js'
import { publicActions } from './public.js'

const client = anvilMainnet.getClient().extend(publicActions)
Expand Down Expand Up @@ -335,16 +332,11 @@ describe('smoke test', () => {
})

test('getProof', async () => {
const client = createPublicClient({
chain: base,
transport: http(),
})

expect(
await client.getProof({
address: '0x4200000000000000000000000000000000000016',
address: wagmiContractConfig.address,
storageKeys: [
'0x4a932049252365b3eedbc5190e18949f2ec11f39d3bef2d259764799a1b27d99',
'0x0000000000000000000000000000000000000000000000000000000000000000',
],
}),
).toBeDefined()
Expand Down
16 changes: 8 additions & 8 deletions src/tempo/actions/reward.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const client = getClient({
account,
})

describe('claimSync', () => {
describe.skip('claimSync', () => {
test('default', async () => {
const { token } = await setupToken(client)

Expand Down Expand Up @@ -58,7 +58,7 @@ describe('claimSync', () => {
})
})

describe('distributeSync', () => {
describe.skip('distributeSync', () => {
test('default', async () => {
const { token } = await setupToken(client)

Expand Down Expand Up @@ -116,7 +116,7 @@ describe('distributeSync', () => {
})
})

describe('getGlobalRewardPerToken', () => {
describe.skip('getGlobalRewardPerToken', () => {
test('default', async () => {
const { token } = await setupToken(client)

Expand Down Expand Up @@ -164,7 +164,7 @@ describe('getGlobalRewardPerToken', () => {
})
})

describe('getPendingRewards', () => {
describe.skip('getPendingRewards', () => {
test('default', async () => {
const { token } = await setupToken(client)

Expand Down Expand Up @@ -208,7 +208,7 @@ describe('getPendingRewards', () => {
})
})

describe('getUserRewardInfo', () => {
describe.skip('getUserRewardInfo', () => {
test('default', async () => {
const { token } = await setupToken(client)

Expand Down Expand Up @@ -292,7 +292,7 @@ describe('getUserRewardInfo', () => {
})
})

describe('setRecipientSync', () => {
describe.skip('setRecipientSync', () => {
test('default', async () => {
const { token } = await setupToken(client)

Expand Down Expand Up @@ -331,7 +331,7 @@ describe('setRecipientSync', () => {
})
})

describe('watchRewardDistributed', () => {
describe.skip('watchRewardDistributed', () => {
test('default', async () => {
const { token } = await setupToken(client)

Expand Down Expand Up @@ -379,7 +379,7 @@ describe('watchRewardDistributed', () => {
})
})

describe('watchRewardRecipientSet', () => {
describe.skip('watchRewardRecipientSet', () => {
test('default', async () => {
const { token } = await setupToken(client)

Expand Down
2 changes: 1 addition & 1 deletion src/tempo/actions/simulate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('simulateBlocks', () => {
),
}).toMatchInlineSnapshot(`
{
"gasUsed": 287370n,
"gasUsed": 287170n,
"logs": [
{
"address": "0x20c0000000000000000000000000000000000001",
Expand Down
Loading