Skip to content
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

Add GetCodeFromHash method to StateDB #331

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 5 additions & 0 deletions core/state/statedb_arbitrum.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,3 +297,8 @@ func (p RecentWasms) Copy() RecentWasms {
}
return RecentWasms{cache: &cache}
}

func (s *StateDB) GetCodeFromHash(codeHash common.Hash) ([]byte, error) {
// Not passing in an address is supported pre-Verkle, as in Blockchain's ContractCodeWithPrefix method.
return s.db.ContractCode(common.Address{}, codeHash)
}
1 change: 1 addition & 0 deletions core/vm/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type StateDB interface {
SetStylusPagesOpen(open uint16)
AddStylusPages(new uint16) (uint16, uint16)
AddStylusPagesEver(new uint16)
GetCodeFromHash(common.Hash) ([]byte, error)

Deterministic() bool
Database() state.Database
Expand Down
Loading