Durable, beneficiary-bound subaddress index reservation
This commit is contained in:
@@ -4,6 +4,7 @@ export const CUSTODY_DB_ACTION_ARGUMENT_COUNTS = {
|
||||
'initialize-mainnet-custody-identity': 1,
|
||||
'migrate-pilot-schema': 0,
|
||||
'initialize-pilot-custody-identity': 1,
|
||||
'grant-pilot-deposit-reservation-runtime': 1,
|
||||
'grant-runtime': 1,
|
||||
'grant-monero-observer-runtime': 1,
|
||||
'grant-monero-deposit-allocator-runtime': 1,
|
||||
@@ -53,7 +54,7 @@ export function assertMainnetCustodyOperationAcknowledged(action: CustodyDbActio
|
||||
}
|
||||
|
||||
export function assertPilotCustodyActionAllowed(action: CustodyDbAction, isPilot: boolean): void {
|
||||
const pilotActions = ['migrate-pilot-schema', 'initialize-pilot-custody-identity'];
|
||||
const pilotActions = ['migrate-pilot-schema', 'initialize-pilot-custody-identity', 'grant-pilot-deposit-reservation-runtime'];
|
||||
if ((isPilot && !pilotActions.includes(action)) || (!isPilot && pilotActions.includes(action))) {
|
||||
throw new Error(isPilot
|
||||
? 'Pilot profile permits only pilot schema migration and identity-only initialization through this CLI'
|
||||
@@ -61,6 +62,12 @@ export function assertPilotCustodyActionAllowed(action: CustodyDbAction, isPilot
|
||||
}
|
||||
}
|
||||
|
||||
export function assertPilotReservationGrantAcknowledged(action: CustodyDbAction, acknowledgement: string | undefined): void {
|
||||
if (action === 'grant-pilot-deposit-reservation-runtime' && acknowledgement !== 'reservation-only-no-addresses') {
|
||||
throw new Error('Pilot reservation role grant requires explicit reservation-only/no-addresses acknowledgement');
|
||||
}
|
||||
}
|
||||
|
||||
export function assertPilotSchemaMigrationAcknowledged(action: CustodyDbAction, acknowledgement: string | undefined): void {
|
||||
if (action === 'migrate-pilot-schema' && acknowledgement !== 'explicit-pilot-schema-migration-only') {
|
||||
throw new Error('Pilot schema migration requires explicit pilot schema-migration acknowledgement');
|
||||
|
||||
Reference in New Issue
Block a user