Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Use single ContractClassCache #876

@Oppen

Description

@Oppen

We currently use two different types for our compiled contract caches:

pub type ContractClassCache = HashMap<ClassHash, ContractClass>;
pub type CasmClassCache = HashMap<ClassHash, CasmContractClass>;

For each of these, CachedState contains an individual field. Both are checked every time we need to refer to a contract.

We also have a CompiledClass enum which has variants for both ContractClass and CasmContractClass, which is actually the one used as return value in the relevant functions.
We can simplify the implementation, as well as get some minor savings, by simply replacing the first two types with:

pub type CompiledClassCache = HashMap<ClassHash, CompiledClass>;

and using a single field containing both kinds of contracts.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions