Skip to content

Commit

Permalink
return error from ReadWasmSchemaVersion
Browse files Browse the repository at this point in the history
  • Loading branch information
magicxyyz committed Aug 12, 2024
1 parent 01e2210 commit 5ed6b5f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions core/rawdb/accessors_state_arbitrum.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func WriteActivatedAsm(db ethdb.KeyValueWriter, target Target, moduleHash common
}
}

// Retrieves the activated asm for a given moduleHash and target
func ReadActivatedAsm(db ethdb.KeyValueReader, target Target, moduleHash common.Hash) []byte {
prefix, err := target.keyPrefix()
if err != nil {
Expand All @@ -95,11 +96,7 @@ func WriteWasmSchemaVersion(db ethdb.KeyValueWriter) {
}
}

// Retrieves wasm schema version, if the corresponding key is not found returns version 0
func ReadWasmSchemaVersion(db ethdb.KeyValueReader) []byte {
version, err := db.Get(wasmSchemaVersionKey)
if err != nil || len(version) == 0 {
return []byte{0}
}
return version
// Retrieves wasm schema version
func ReadWasmSchemaVersion(db ethdb.KeyValueReader) ([]byte, error) {
return db.Get(wasmSchemaVersionKey)
}

0 comments on commit 5ed6b5f

Please sign in to comment.