Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
fix: update snap object keys to be mandatory and move name to metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
montelaidev committed Aug 30, 2023
1 parent 6c94e22 commit dfcf4d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/internal/types.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ describe('InternalAccount', () => {
keyring: {
type: 'Test Keyring',
},
name: 'Account 1',
},
};

Expand All @@ -29,6 +30,7 @@ describe('InternalAccount', () => {
type: 'eip155:eoa',
metadata: {
keyring: {},
name: 'Account 1',
},
};

Expand All @@ -44,7 +46,9 @@ describe('InternalAccount', () => {
options: {},
methods: [],
type: 'eip155:eoa',
metadata: {},
metadata: {
name: 'Account 1',
},
};

expect(() => assert(account, InternalAccountStruct)).toThrow(
Expand Down Expand Up @@ -77,6 +81,7 @@ describe('InternalAccount', () => {
keyring: {
type: 'Test Keyring',
},
name: 'Account 1',
extra: 'field',
},
};
Expand Down
6 changes: 3 additions & 3 deletions src/internal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ export const InternalAccountStruct = object({
metadata: object({
snap: optional(
object({
id: optional(string()),
name: optional(string()),
enabled: optional(boolean()),
id: string(),
enabled: boolean(),
}),
),
name: string(),
keyring: object({
type: string(),
}),
Expand Down

0 comments on commit dfcf4d2

Please sign in to comment.