Skip to content

Commit

Permalink
ensure use null instead of empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
oXtxNt9U committed Dec 18, 2024
1 parent 6c8891c commit 3d7aae6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions packages/api-database/source/models/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Column, Entity } from "typeorm";
@Entity({
name: "wallets",
})
//@Unique("unique_wallet_public_key", ["publicKey"])
export class Wallet {
@Column({
primary: true,
Expand All @@ -30,7 +29,6 @@ export class Wallet {
})
public nonce!: string;

// TODO: separate tables for 1:n attributes
@Column({
default: undefined,
nullable: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/api-sync/source/restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
});
}
Expand Down
4 changes: 2 additions & 2 deletions packages/api-sync/source/service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -221,7 +221,7 @@ export class Sync implements Contracts.ApiSync.Service {
if (!accountUpdates[validatorAddress]) {
wallets.push([
validatorAddress,
"",
addressToPublicKey[validatorAddress] ?? null,
"-1",
"-1",
{
Expand Down

0 comments on commit 3d7aae6

Please sign in to comment.