Skip to content
This repository was archived by the owner on Feb 8, 2025. It is now read-only.

Commit 422de4f

Browse files
committed
fix(api): Policy isDraft field
1 parent 24bf632 commit 422de4f

File tree

8 files changed

+176
-171
lines changed

8 files changed

+176
-171
lines changed

api/dbschema/bootstrap.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ configure instance set query_work_mem := <cfg::memory>"8MiB";
1212
configure instance set shared_buffers := <cfg::memory>"2GiB";
1313

1414
# Total memory available to the database for caching - 75%
15-
configure instance set effective_cache_size := <cfg::memory>"3GiB";
15+
configure instance set effective_cache_size := <cfg::memory>"6GiB";

api/dbschema/edgeql-js/__spec__.ts

+70-70
Large diffs are not rendered by default.

api/dbschema/edgeql-js/modules/default.ts

+77-77
Large diffs are not rendered by default.

api/dbschema/interfaces.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ export namespace $default {
215215
"proposal"?: Transaction | null;
216216
"initState": boolean;
217217
"isActive": boolean;
218-
"isDraft": boolean;
219218
"latest"?: PolicyState | null;
220219
"isLatest": boolean;
220+
"isDraft": boolean;
221221
}
222222
export interface Policy extends PolicyState {
223223
"approvers": Approver[];
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CREATE MIGRATION m1ob6arfwyamzcpgk2hgzhby3iwv3moewthqacorsw2mtyjkopdoaq
2+
ONTO m13qxppnkqofigih7dxkipm2lh6k3ahrqerachqhdzihw76nb6i3aa
3+
{
4+
ALTER TYPE default::PolicyState {
5+
ALTER PROPERTY isDraft {
6+
USING ((__source__ ?= .draft));
7+
};
8+
};
9+
};

api/dbschema/policy.esdl

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ module default {
1919
required initState := .activationBlock ?= 0;
2020
required hasBeenActive := exists .activationBlock;
2121
required isActive := .isLatest and .hasBeenActive;
22-
required isDraft := exists .draft;
22+
required isDraft := (__source__ ?= .draft);
2323
latest := (__source__ if .isLatest else latestPolicy(.account, .key));
2424
draft := assert_single((
2525
with account := __source__.account, key := __source__.key
@@ -94,9 +94,9 @@ module default {
9494
}
9595

9696
type TransfersConfig {
97-
multi limits: TransferLimit { constraint exclusive; }
9897
required defaultAllow: bool { default := true; };
9998
required budget: uint32;
99+
multi limits: TransferLimit { constraint exclusive; }
100100
}
101101

102102
type TransferLimit {

api/edgedb.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
[edgedb]
2-
server-version = "5.4"
2+
server-version = "5.6"
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
// GENERATED by @edgedb/generate v0.5.3
22

3-
import type { Executor } from 'edgedb';
3+
import type {Executor} from "edgedb";
44

55
export type DeleteTransactionArgs = {
6-
readonly transaction: string;
6+
readonly "transaction": string;
77
};
88

99
export type DeleteTransactionReturns = {
10-
transaction: {
11-
id: string;
12-
account: {
13-
address: string;
10+
"transaction": {
11+
"id": string;
12+
"account": {
13+
"address": string;
1414
};
1515
} | null;
16-
deletedPolicies: Array<{
17-
id: string;
16+
"deletedPolicies": Array<{
17+
"id": string;
1818
}>;
19-
deletedTransaction: {
20-
id: string;
19+
"deletedTransaction": {
20+
"id": string;
2121
} | null;
2222
};
2323

24-
export function deleteTransaction(
25-
client: Executor,
26-
args: DeleteTransactionArgs,
27-
): Promise<DeleteTransactionReturns> {
28-
return client.queryRequiredSingle(
29-
`\
24+
export function deleteTransaction(client: Executor, args: DeleteTransactionArgs): Promise<DeleteTransactionReturns> {
25+
return client.queryRequiredSingle(`\
3026
with t := (select Transaction filter .id = <uuid>$transaction)
3127
select {
3228
transaction := (
@@ -35,9 +31,9 @@ select {
3531
account: { address }
3632
}
3733
),
34+
# Delete policies the proposal was going to activate
3835
deletedPolicies := (delete t.<proposal[is PolicyState]),
3936
deletedTransaction := (delete t)
40-
};`,
41-
args,
42-
);
37+
};`, args);
38+
4339
}

0 commit comments

Comments
 (0)