Skip to content
This repository was archived by the owner on Mar 29, 2023. It is now read-only.

Commit 9387f3f

Browse files
authored
fix: delegation chain imports
fix: delegation chain imports
2 parents 36ac057 + 032f592 commit 9387f3f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ class Client {
324324
? settings.get('delegations')
325325
: {}
326326

327-
delegations[did] = { ucan: imported, alias }
327+
delegations[did] = { ucan: await delegationToString(imported), alias }
328328
settings.set('delegations', delegations)
329329

330330
return imported

src/settings.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { delegationToString, stringToDelegation } from './encoding.js'
99
* @property {string} [agent_secret]
1010
* @property {string} [account_secret]
1111
* @property {string} [email]
12-
* @property {string} [delegation]
12+
* @property {string} [account]
1313
* @property {any} [delegations]
1414
*/
1515

@@ -71,8 +71,8 @@ export async function objectToMap(objectToParse) {
7171
settings.set('email', objectToParse.email)
7272
}
7373

74-
if (objectToParse.delegation) {
75-
settings.set('delegation', objectToParse.delegation)
74+
if (objectToParse.account) {
75+
settings.set('account', objectToParse.account)
7676
}
7777

7878
if (objectToParse.delegations) {
@@ -150,8 +150,8 @@ export async function exportSettings(settings) {
150150
}
151151
}
152152

153-
if (settings.has('delegation')) {
154-
output.delegation = settings.get('delegation')
153+
if (settings.has('account')) {
154+
output.account = settings.get('account')
155155
}
156156

157157
if (settings.has('delegations')) {

0 commit comments

Comments
 (0)