(keyringId, attrMap)
| 63 | } |
| 64 | |
| 65 | async set(keyringId, attrMap) { |
| 66 | if (!this.has(keyringId)) { |
| 67 | throw new Error(`Keyring does not exist for id: ${keyringId}`); |
| 68 | } |
| 69 | if (typeof attrMap !== 'object') { |
| 70 | throw new Error('KeyringAttrMap.set no attrMap provided'); |
| 71 | } |
| 72 | const keyringAttr = super.get(keyringId) || {}; |
| 73 | Object.assign(keyringAttr, attrMap); |
| 74 | super.set(keyringId, keyringAttr); |
| 75 | await this.store(); |
| 76 | } |
| 77 | |
| 78 | async store() { |
| 79 | await mvelo.storage.set('mvelo.keyring.attributes', this.toObject()); |
no test coverage detected