Skip to content

Commit 11c4bce

Browse files
authored
237-bug-v31---vaults-list-if-off (#241)
* fix: unlink vault on deployment * chore: add default fields across schema
1 parent d9414c5 commit 11c4bce

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

ponder.schema.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ const VaultColumns = (t: PgColumnsBuilders) => ({
189189
assetAddress: t.hex().notNull(),
190190
factory: t.text().notNull(),
191191
manager: t.text(),
192+
...defaultColumns(t),
192193
});
193194
export const Vault = onchainTable("vault", VaultColumns, (t) => ({
194195
id: primaryKey({ columns: [t.id, t.centrifugeId] }),
@@ -659,6 +660,8 @@ const EpochInvestOrderColumns = (t: PgColumnsBuilders) => ({
659660
issuedSharesAmount: t.bigint().default(0n),
660661
issuedWithNavPoolPerShare: t.bigint().default(0n),
661662
issuedWithNavAssetPerShare: t.bigint().default(0n),
663+
664+
...defaultColumns(t),
662665
});
663666

664667
export const EpochInvestOrder = onchainTable(
@@ -701,6 +704,8 @@ const EpochRedeemOrderColumns = (t: PgColumnsBuilders) => ({
701704
revokedPoolAmount: t.bigint().default(0n), // payout of assets for shares, in pool denomination
702705
revokedWithNavPoolPerShare: t.bigint().default(0n),
703706
revokedWithNavAssetPerShare: t.bigint().default(0n),
707+
708+
...defaultColumns(t),
704709
});
705710

706711
export const EpochRedeemOrder = onchainTable(
@@ -757,7 +762,7 @@ const AssetColumns = (t: PgColumnsBuilders) => ({
757762
decimals: t.integer().notNull(),
758763
name: t.text(),
759764
symbol: t.text(),
760-
...defaultColumns(t, false),
765+
...defaultColumns(t),
761766
});
762767

763768
export const Asset = onchainTable("asset", AssetColumns, (t) => ({
@@ -813,7 +818,7 @@ const HoldingColumns = (t: PgColumnsBuilders) => ({
813818
// Spoke side amounts and values
814819
assetQuantity: t.bigint().default(0n),
815820
totalValue: t.bigint().default(0n),
816-
...defaultColumns(t, false),
821+
...defaultColumns(t),
817822
});
818823

819824
export const Holding = onchainTable("holding", HoldingColumns, (t) => ({
@@ -852,6 +857,7 @@ export const HoldingAccountColumns = (t: PgColumnsBuilders) => ({
852857
id: t.text().notNull(),
853858
tokenId: t.hex().notNull(),
854859
kind: HoldingAccountType("holding_account_type").notNull(),
860+
...defaultColumns(t),
855861
});
856862

857863
export const HoldingAccount = onchainTable("holding_account", HoldingAccountColumns, (t) => ({
@@ -869,7 +875,7 @@ export const EscrowColumns = (t: PgColumnsBuilders) => ({
869875
address: t.hex().notNull(),
870876
poolId: t.bigint().notNull(),
871877
centrifugeId: t.text().notNull(),
872-
...defaultColumns(t, false),
878+
...defaultColumns(t),
873879
});
874880

875881
export const Escrow = onchainTable("escrow", EscrowColumns, (t) => ({
@@ -895,7 +901,7 @@ export const HoldingEscrowColumns = (t: PgColumnsBuilders) => ({
895901
assetAmount: t.bigint().default(0n),
896902
assetPrice: t.bigint().default(0n),
897903
escrowAddress: t.hex().notNull(),
898-
...defaultColumns(t, true),
904+
...defaultColumns(t),
899905
});
900906
export const HoldingEscrow = onchainTable("holding_escrow", HoldingEscrowColumns, (t) => ({
901907
id: primaryKey({ columns: [t.tokenId, t.assetId] }),
@@ -1361,7 +1367,7 @@ export const HoldingEscrowSnapshot = onchainTable(
13611367

13621368
const AccountColumns = (t: PgColumnsBuilders) => ({
13631369
address: t.hex().notNull(),
1364-
...defaultColumns(t, false),
1370+
...defaultColumns(t),
13651371
});
13661372
export const Account = onchainTable("account", AccountColumns, (t) => ({
13671373
id: primaryKey({ columns: [t.address] }),

src/handlers/spokeHandlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { snapshotter } from "../helpers/snapshotter";
1717
import { HoldingEscrowSnapshot } from "ponder:schema";
1818
import { deployVault, linkVault, unlinkVault } from "./vaultRegistryHandlers";
1919
import { getInitialHolders } from "../config";
20-
import { initialisePosition } from "../services/TokenInstancePositionService";
20+
import { initialisePosition } from "../services";
2121

2222
multiMapper("spoke:DeployVault", deployVault);
2323

src/handlers/vaultRegistryHandlers.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export async function deployVault({
6666
kind: vaultKind,
6767
manager,
6868
isActive: true,
69+
status: "Unlinked",
6970
},
7071
event
7172
)) as VaultService;

0 commit comments

Comments
 (0)