[#824] Refactor aliases storage in Cleveland
Description
Problem: We're storing aliases in three five places:
PureState._psAliases
: stores aliases of contracts and implicit accounts (and secret keys of implicit accounts).PureState._psContractsNames
: stores aliases of contracts.GState.gsAddressAliases
: stores aliases of contracts.-
PureState._psImplicitAliases
: stores aliases (and secret keys) of implicit accounts. -
PureState._psContractAliases
: stores aliases of contracts. -
PureState._psContractsNames
: stores aliases of contracts. -
GState.gsImplicitAddressAliases
: not currently used, it's always empty. -
GState.gsContractAddressAliases
: stores aliases of contracts.
This MR:
- Stores aliases of implicit accounts in
GState.gsImplicitAddressAliases
.GState
is now the single source of truth for aliases. - Deletes
PureState._psContractsNames
and_psContractAliases
as they're entirely redundant. - Delete alias data from
PureState._psImplicitAliases
, replace it with_psSecretKeys :: Map Address SecretKey
.~
It also deletes GSAddImplicitAddressAlias
, as it's not being used anywhere.
See each commit's message/contents - each of the above steps is done in an individual commit to make it easier to review.
Related issue(s)
Resolves #824 (closed)
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.
Edited by Diogo Castro