feat: update SDK to work with refactored delegation pallet#406
feat: update SDK to work with refactored delegation pallet#406
Conversation
…gationBaseNode with DelegationNode
rflechtner
left a comment
There was a problem hiding this comment.
A bunch of suggestions but nothing critical. Nice work!
|
@rflechtner good catches, thanks! I am not sure how to proceed now, as test cases are broken. Should we merge it? Should we not merge it? |
I say merge it - the delegationNode tests succeed and that's enough for me. Tests are broken on develop and need fixing after the DID stuff is merged. |
|
@rflechtner please take one last look at the changes. I found a bug in the |
Looks good to me! Especially after the Object.assign() issue was solved |
fixes KILTProtocol/ticket#1485
Merges
DelegationBaseNodeandDelegationNodeintoDelegationNode, deletesDelegationRootNodeand addsDelegationHierarchyDetails.Integration tests are passing if using the blockchain version refactoring the delegation pallet and the latest updated types. Of course, some tests are broken as we already use the new DID pallet on the server.
One thing that requires more attention is how to synchronise the state of a node with what's on the blockchain. For instance, how to fetch the latest vector of children IDs if new nodes are added under a given node. For the moment, I have added a utility function
core/src/delegation/DelegationNode.utils.tswith the signatureexport async function getSyncedState(delegationNode: DelegationNode): Promise<DelegationNode>to update and return a node state. We might want to think about some other ways to do that.Checklist: