Skip to content

Commit

Permalink
feat(types): #1989: change isControlledAddress method to `getIndexB…
Browse files Browse the repository at this point in the history
…yAddress`
  • Loading branch information
VanishMax committed Jan 28, 2025
1 parent 2350c09 commit b045f75
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions packages/types/src/indexed-db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ export interface IndexedDbInterface {
getOwnedPositionIds(
positionState: PositionState | undefined,
tradingPair: TradingPair | undefined,
subaccount: AddressIndex | undefined,
): AsyncGenerator<PositionId, void>;
addPosition(positionId: PositionId, position: Position): Promise<void>;
updatePosition(positionId: PositionId, newState: PositionState): Promise<void>;
addPosition(positionId: PositionId, position: Position, subaccount?: AddressIndex): Promise<void>;
updatePosition(
positionId: PositionId,
newState: PositionState,
subaccount?: AddressIndex,
): Promise<void>;
addEpoch(startHeight: bigint): Promise<void>;
getEpochByHeight(height: bigint): Promise<Epoch | undefined>;
upsertValidatorInfo(validatorInfo: ValidatorInfo): Promise<void>;
Expand Down Expand Up @@ -297,6 +302,7 @@ export interface PenumbraDb extends DBSchema {
export interface PositionRecord {
id: Jsonified<PositionId>; // PositionId (must be JsonValue because ['id']['inner'] is a key )
position: Jsonified<Position>; // Position
subaccount?: Jsonified<AddressIndex>; // Position AddressIndex
}

export type Tables = Record<string, StoreNames<PenumbraDb>>;
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/servers.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ScanBlockResult } from './state-commitment-tree.js';
import { CompactBlock } from '@penumbra-zone/protobuf/penumbra/core/component/compact_block/v1/compact_block_pb';
import { MerkleRoot } from '@penumbra-zone/protobuf/penumbra/crypto/tct/v1/tct_pb';
import { Address } from '@penumbra-zone/protobuf/penumbra/core/keys/v1/keys_pb';
import { Address, AddressIndex } from '@penumbra-zone/protobuf/penumbra/core/keys/v1/keys_pb';

export interface ViewServerInterface {
scanBlock(compactBlock: CompactBlock, skipTrialDecrypt: boolean): Promise<boolean>;
Expand All @@ -12,5 +12,5 @@ export interface ViewServerInterface {

getSctRoot(): MerkleRoot;

isControlledAddress(address: Address): boolean;
getIndexByAddress(address: Address): AddressIndex | undefined;
}

0 comments on commit b045f75

Please sign in to comment.