From 3d7aae6d8f7b2e63e31c7580e03bee8ef88d7a72 Mon Sep 17 00:00:00 2001 From: oXtxNt9U <120286271+oXtxNt9U@users.noreply.github.com> Date: Wed, 18 Dec 2024 14:06:02 +0900 Subject: [PATCH] ensure use null instead of empty string --- packages/api-database/source/models/wallet.ts | 2 -- packages/api-sync/source/restore.ts | 2 +- packages/api-sync/source/service.ts | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/api-database/source/models/wallet.ts b/packages/api-database/source/models/wallet.ts index 2a1d5e4cb..894cd7de4 100644 --- a/packages/api-database/source/models/wallet.ts +++ b/packages/api-database/source/models/wallet.ts @@ -3,7 +3,6 @@ import { Column, Entity } from "typeorm"; @Entity({ name: "wallets", }) -//@Unique("unique_wallet_public_key", ["publicKey"]) export class Wallet { @Column({ primary: true, @@ -30,7 +29,6 @@ export class Wallet { }) public nonce!: string; - // TODO: separate tables for 1:n attributes @Column({ default: undefined, nullable: true, diff --git a/packages/api-sync/source/restore.ts b/packages/api-sync/source/restore.ts index 5df8be212..4cc34a569 100644 --- a/packages/api-sync/source/restore.ts +++ b/packages/api-sync/source/restore.ts @@ -396,7 +396,7 @@ export class Restore { }, balance: Utils.BigNumber.make(account.balance).toFixed(), nonce: Utils.BigNumber.make(account.nonce).toFixed(), - publicKey: context.addressToPublicKey[account.address] ?? "", + publicKey: context.addressToPublicKey[account.address] ?? null, updated_at: "0", }); } diff --git a/packages/api-sync/source/service.ts b/packages/api-sync/source/service.ts index 03227bd3a..e2db8d4ba 100644 --- a/packages/api-sync/source/service.ts +++ b/packages/api-sync/source/service.ts @@ -204,7 +204,7 @@ export class Sync implements Contracts.ApiSync.Service { return [ account.address, - addressToPublicKey[account.address] ?? "", + addressToPublicKey[account.address] ?? null, Utils.BigNumber.make(account.balance).toFixed(), Utils.BigNumber.make(account.nonce).toFixed(), attributes, @@ -221,7 +221,7 @@ export class Sync implements Contracts.ApiSync.Service { if (!accountUpdates[validatorAddress]) { wallets.push([ validatorAddress, - "", + addressToPublicKey[validatorAddress] ?? null, "-1", "-1", {