Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 committed Aug 15, 2024
1 parent a7ce0f0 commit 7e4bd5f
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 33 deletions.
18 changes: 9 additions & 9 deletions packages/block/examples/6110Requests.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Block } from '@ethereumjs/block'
import { createBlock, genRequestsTrieRoot } from '@ethereumjs/block'
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
import {
bytesToBigInt,
DepositRequest,
randomBytes,
type CLRequest,
type CLRequestType,
DepositRequest,
bytesToBigInt,
randomBytes,
} from '@ethereumjs/util'

const main = async () => {
const common = new Common({
chain: Chain.Mainnet,
chain: Mainnet,
hardfork: Hardfork.Prague,
})

Expand All @@ -23,9 +23,9 @@ const main = async () => {
}
const request = DepositRequest.fromRequestData(depositRequestData) as CLRequest<CLRequestType>
const requests = [request]
const requestsRoot = await Block.genRequestsTrieRoot(requests)
const requestsRoot = await genRequestsTrieRoot(requests)

const block = Block.fromBlockData(
const block = createBlock(
{
requests,
header: { requestsRoot },
Expand All @@ -39,4 +39,4 @@ const main = async () => {
)
}

main()
void main()
18 changes: 9 additions & 9 deletions packages/block/examples/7002Requests.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Block } from '@ethereumjs/block'
import { createBlock, genRequestsTrieRoot } from '@ethereumjs/block'
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
import {
bytesToBigInt,
randomBytes,
WithdrawalRequest,
type CLRequest,
type CLRequestType,
WithdrawalRequest,
bytesToBigInt,
randomBytes,
} from '@ethereumjs/util'

const main = async () => {
const common = new Common({
chain: Chain.Mainnet,
chain: Mainnet,
hardfork: Hardfork.Prague,
})

Expand All @@ -23,9 +23,9 @@ const main = async () => {
withdrawalRequestData,
) as CLRequest<CLRequestType>
const requests = [request]
const requestsRoot = await Block.genRequestsTrieRoot(requests)
const requestsRoot = await genRequestsTrieRoot(requests)

const block = Block.fromBlockData(
const block = createBlock(
{
requests,
header: { requestsRoot },
Expand All @@ -39,4 +39,4 @@ const main = async () => {
)
}

main()
void main()
17 changes: 8 additions & 9 deletions packages/block/examples/7251Requests.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { Block } from '@ethereumjs/block'
import { createBlock, genRequestsTrieRoot } from '@ethereumjs/block'
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
import {
bytesToBigInt,
ConsolidationRequest,
randomBytes,
type CLRequest,
type CLRequestType,
ConsolidationRequest,
randomBytes,
} from '@ethereumjs/util'

const main = async () => {
const common = new Common({
chain: Chain.Mainnet,
chain: Mainnet,
hardfork: Hardfork.Prague,
})

Expand All @@ -23,9 +22,9 @@ const main = async () => {
consolidationRequestData,
) as CLRequest<CLRequestType>
const requests = [request]
const requestsRoot = await Block.genRequestsTrieRoot(requests)
const requestsRoot = await genRequestsTrieRoot(requests)

const block = Block.fromBlockData(
const block = createBlock(
{
requests,
header: { requestsRoot },
Expand All @@ -39,4 +38,4 @@ const main = async () => {
)
}

main()
void main()
9 changes: 5 additions & 4 deletions packages/tx/examples/EOACodeTx.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Chain, Common, Hardfork } from '@ethereumjs/common'
import { EOACodeEIP7702Transaction } from '@ethereumjs/tx'
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
import { create7702EOACodeTx } from '@ethereumjs/tx'

import type { PrefixedHexString } from '@ethereumjs/util'

const ones32 = `0x${'01'.repeat(32)}` as PrefixedHexString

const common = new Common({ chain: Chain.Mainnet, hardfork: Hardfork.Cancun, eips: [7702] })
const tx = EOACodeEIP7702Transaction.fromTxData(
const common = new Common({ chain: Mainnet, hardfork: Hardfork.Cancun, eips: [7702] })
const tx = create7702EOACodeTx(
{
authorizationList: [
{
Expand Down
4 changes: 2 additions & 2 deletions packages/util/examples/accountPartial.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Account } from '@ethereumjs/util'
import { createPartialAccount } from '@ethereumjs/util'

const account = Account.fromPartialAccountData({
const account = createPartialAccount({
nonce: '0x02',
balance: '0x0384',
})
Expand Down

0 comments on commit 7e4bd5f

Please sign in to comment.