Skip to content

Commit 630852e

Browse files
committed
rm custody
1 parent 4e96ee8 commit 630852e

24 files changed

+39
-529
lines changed

.changeset/slick-bugs-admire.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@penumbra-zone/services': major
3+
---
4+
5+
remove custody service
6+
7+
new custody service implementations should be deployed in dedicated packages

packages/services/package.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,9 @@
3232
"@bufbuild/protobuf": "^1.10.0",
3333
"@connectrpc/connect": "^1.6.1",
3434
"@penumbra-zone/bech32m": "workspace:*",
35-
"@penumbra-zone/crypto-web": "workspace:*",
3635
"@penumbra-zone/getters": "workspace:*",
3736
"@penumbra-zone/protobuf": "workspace:*",
3837
"@penumbra-zone/storage": "workspace:*",
39-
"@penumbra-zone/transport-dom": "workspace:*",
4038
"@penumbra-zone/types": "workspace:*",
4139
"@penumbra-zone/wasm": "workspace:*",
4240
"@types/chrome": "^0.0.268"
@@ -45,11 +43,8 @@
4543
"@bufbuild/protobuf": "^1.10.0",
4644
"@connectrpc/connect": "^1.6.1",
4745
"@penumbra-zone/bech32m": "workspace:*",
48-
"@penumbra-zone/crypto-web": "workspace:*",
4946
"@penumbra-zone/getters": "workspace:*",
5047
"@penumbra-zone/protobuf": "workspace:*",
51-
"@penumbra-zone/storage": "workspace:*",
52-
"@penumbra-zone/transport-dom": "workspace:*",
5348
"@penumbra-zone/types": "workspace:*",
5449
"@penumbra-zone/wasm": "workspace:*"
5550
}

packages/services/src/ctx/approver.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { ContextKey, createContextKey, Client } from '@connectrpc/connect';
22
import type { CustodyService } from '@penumbra-zone/protobuf';
33

4-
export const custodyClientCtx: ContextKey<Client<typeof CustodyService> | undefined> =
5-
createContextKey(undefined);
4+
export const custodyClientCtx: ContextKey<Client<typeof CustodyService>> = createContextKey(
5+
null as never,
6+
{ description: 'View service may call the custody service for authorizations' },
7+
);
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { Code, ConnectError, createContextKey } from '@connectrpc/connect';
22
import { FullViewingKey } from '@penumbra-zone/protobuf/penumbra/core/keys/v1/keys_pb';
33

4-
export const fvkCtx = createContextKey<() => Promise<FullViewingKey>>(() =>
5-
Promise.reject(new ConnectError('No full viewing key available', Code.FailedPrecondition)),
4+
export const fvkCtx = createContextKey<() => Promise<FullViewingKey>>(
5+
/** A stub implementation that always throws an error. */
6+
() => Promise.reject(new ConnectError('Default full viewing key stub', Code.Unimplemented)),
7+
{ description: 'View service requires a full viewing key' },
68
);

packages/services/src/ctx/prax.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
* portable service implementations, should eventually be refactored.
44
*/
55

6-
import { ConnectError, createContextKey } from '@connectrpc/connect';
6+
import { createContextKey } from '@connectrpc/connect';
77
import type { ServicesInterface } from '@penumbra-zone/types/services';
88

9-
export const servicesCtx = createContextKey<() => Promise<ServicesInterface>>(() =>
10-
Promise.reject(new ConnectError('No prax services interface available')),
11-
);
9+
export const servicesCtx = createContextKey<() => Promise<ServicesInterface>>(null as never, {
10+
description: 'A random collection of interfaces',
11+
});

packages/services/src/ctx/spend-key.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { ContextKey, createContextKey, Client } from '@connectrpc/connect';
22
import type { StakeService } from '@penumbra-zone/protobuf';
33

4-
export const stakeClientCtx: ContextKey<Client<typeof StakeService> | undefined> =
5-
createContextKey(undefined);
4+
export const stakeClientCtx: ContextKey<Client<typeof StakeService>> = createContextKey(
5+
null as never,
6+
{ description: 'View service may call the stake service for delegation info' },
7+
);
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import { ConnectError, createContextKey } from '@connectrpc/connect';
1+
import { Code, ConnectError, createContextKey } from '@connectrpc/connect';
22
import { WalletId } from '@penumbra-zone/protobuf/penumbra/core/keys/v1/keys_pb';
33

4-
export const walletIdCtx = createContextKey<() => Promise<WalletId>>(() =>
5-
Promise.reject(new ConnectError('No wallet id available')),
4+
export const walletIdCtx = createContextKey<() => Promise<WalletId>>(
5+
/** A stub implementation that always throws an error. */
6+
() => Promise.reject(new ConnectError('Default wallet id stub', Code.Unimplemented)),
7+
{ description: 'Some view service methods will refer to the wallet id' },
68
);

packages/services/src/custody-service/authorize.test.ts

Lines changed: 0 additions & 249 deletions
This file was deleted.

0 commit comments

Comments
 (0)