Txm compatibility with keystore lib #318
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.
The existing EVM keystore interface (built on top of the the common core.Keystore interface https://github.com/smartcontractkit/chainlink-common/blob/main/pkg/types/core/keystore.go#L23) assumes that the "accounts" in the common keystore are all EVM addresses: https://github.com/smartcontractkit/chainlink-evm/blob/develop/pkg/keys/keystore.go#L113.
That works fine if the core.Keystore implementation is backed by the core node which always uses the address as the identifier. However, if the core.Keystore implementation is backed by the newer keystore library, the account name isn't an address anymore but a user specified key name with an EVM prefix (e.g. evm/tx/myPolygonKey1).
The fix proposed here is to just add a EVM keystore implementation which supports address based lookups. That way users of keys/v2 can still use the EVM keystore interface needed for the Txm. For example: