Closed radleylewis closed 5 months ago
This looks much better than before!
I think we are missing a couple of things before we can merge this:
- tests to validate the new behavior
- (optional, but highly recommended) even more simplification of the code:
We now have 3 paths for adding/removing an attribute:
- a. sign and send a transaction directly. (default case)
- b. sign a message using one key and sign and/or send a transaction using another key (metaIdentifierKeyId)
- c. sign a message using one key (signOnly param)
Ideally, we would use the functionality from c. as a first step in b.
Hi @mirceanis. I have pushed some tests up which cover the introduced signOnly
behaviour. Just a few points to clarify:
else
block does not require a sigature (eth_sendTransaction
as opposed to eth_sendRawTransaction
). This means that the logic is not as straight forward as simply returning out if the signOnly
flag is present. That being said, if you are ok with a conditional block within the else statement, I am ok to proceed. Actually, on a side note, this is where I picked up on the behaviour of the ethr-did-resolver
because where no signature is provided it works at present, it is only where a signature is provided that it fails (pertaining to the other PR).All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 89.97%. Comparing base (
1c6627c
) to head (4db3a2d
). Report is 4 commits behind head on next.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
What issue is this PR fixing
Closes #1373
What is being changed
Due to constraints within the secure MetaMask Snap context, it is not possible to invoke the
didManagerAdd(Remove)Service
ordidManagerAdd(Remove)Key
methods on thedid-manager
successfully. Refer here for the list of blocked RPC methods.As outlined in the referenced issue, the changes proposed herein allow for the transaction to be signed only, through the addition of a new
signOnly
flag within one agent (in the demonstration case, by an agent in the constrained MetaMask Snap environment), and then submitted from another context (for example via theethers.InfuraProvider
in another context).Quality
Check all that apply:
pnpm i
,pnpm build
,pnpm test
,pnpm test:browser
locally.Details
I have successfully tested this (with the
did-ethr-provider
on thesepolia
testnet).