-
-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
⬆️ Feat: Upgrade to ethereumjs alpha.1 #1486
base: 11-01-_recycle_feat_reset_storage_slot_if_more_than_one_is_found
Are you sure you want to change the base?
Changes from all commits
f669a2d
171c0b7
15c75b7
896092c
e8652fa
89ef23a
ba30f59
b451111
0147584
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { InvalidAddressError } from '@tevm/errors' | ||
import { EthjsAddress, keccak256, toRlp } from '@tevm/utils' | ||
import { numberToBytes } from 'viem' | ||
import { keccak256, toRlp } from '@tevm/utils' | ||
import { hexToBytes, numberToBytes } from 'viem' | ||
import { describe, expect, it } from 'vitest' | ||
import { Address } from './Address.js' | ||
import { createContractAddress } from './createContractAddress.js' | ||
|
||
describe('createContractAddress', () => { | ||
it('should create a valid contract address with nonce 0', () => { | ||
const from = EthjsAddress.fromString(`0x${'11'.repeat(20)}`) | ||
const from = new Address(hexToBytes(`0x${'11'.repeat(20)}`)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification While the update to use Areas to Address:
🔗 Analysis chainLGTM: Address creation updated correctly. The To ensure consistency across the codebase, let's verify the usage of this new address creation pattern: To address the issue with unrecognized file types, let's search for To ensure all instances of 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify the usage of new Address creation pattern across the codebase.
# Test: Search for new Address creation pattern
rg --type typescript 'new Address\(hexToBytes\(' packages/
# Test: Search for any remaining usage of EthjsAddress
rg --type typescript 'EthjsAddress' packages/
Length of output: 176 Script: #!/bin/bash
# Description: Verify the usage of new Address creation pattern across the codebase by searching .ts and .tsx files.
# Test: Search for new Address creation pattern in .ts and .tsx files
rg 'new Address\(hexToBytes\(' --glob '*.ts' --glob '*.tsx' packages/
# Test: Search for any remaining usage of EthjsAddress in .ts and .tsx files
rg 'EthjsAddress' --glob '*.ts' --glob '*.tsx' packages/
Length of output: 27517 Script: #!/bin/bash
# Description: Locate all instances of EthjsAddress and determine their contexts.
# Search for EthjsAddress usages in .ts and .tsx files
rg 'EthjsAddress' --glob '*.ts' --glob '*.tsx' packages/
Length of output: 27126 |
||
const nonce = 0n | ||
const expectedAddress = keccak256(toRlp([from.bytes, Uint8Array.from([])]), 'bytes').subarray(-20) | ||
|
||
|
@@ -18,7 +18,7 @@ describe('createContractAddress', () => { | |
}) | ||
|
||
it('should create a valid contract address with a non-zero nonce', () => { | ||
const from = EthjsAddress.fromString(`0x${'22'.repeat(20)}`) | ||
const from = new Address(hexToBytes(`0x${'22'.repeat(20)}`)) | ||
const nonce = 1n | ||
const expectedAddress = keccak256(toRlp([from.bytes, numberToBytes(nonce)]), 'bytes').subarray(-20) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Remaining instances of
EthjsAddress.fromString
found.Multiple files still utilize
EthjsAddress.fromString
, indicating that the update is not fully applied. Please ensure all instances are refactored to maintain consistency.🔗 Analysis chain
LGTM! Verify similar changes across the codebase.
The update to the
EthjsAddress
instantiation looks good. It uses the constructor directly withhexToBytes
, which is a more straightforward approach.To ensure consistency, let's verify if similar changes have been made throughout the codebase:
Action Required: Update the search command to correctly target TypeScript files.
Action Required: Update the search command to target
.ts
and.tsx
files using glob patterns.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 84
Script:
Length of output: 99
Script:
Length of output: 15386