This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
Add contractClass
interpretation to address values
#6130
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR description
Addresses #5913. Adds a
contractClass
interpretation to address values. Basically, if we can identify what sort of contract a given address is, it will have this interpretation with more information; otherwise it won't.Yes, this means that the address/contract distinction is now pretty silly -- they now contain the same information but formatted differently. Oh well. I don't want to make a breaking change to make them more unified.
The code is pretty straightforward, not much to explain. I could have further eliminated some minor recomputation by just using
decodeContract
and then doing everything based on the results of that, but I decided it was clearer to do it this way, even if that means callingEvm.Utils.toAddress
twice. :PI also updated the inspector so that it now basically just treats addresses like contracts. Could have distinguished them some but that would have been more work.
I did not update
codec-components
. I figure I can worry about that later; there are likely multiple changes I want to make to address and contracts there.Testing instructions
I added a debugger test for it, I figured that should be enough.