Skip to content

Commit 6a4ae74

Browse files
authored
fix(api-http): use fallback wallet if proposer look up fails (#983)
* add wallet fallback * empty commit * style: resolve style guide violations
1 parent d42c4c1 commit 6a4ae74

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

packages/api-http/source/controllers/controller.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,18 @@ export class Controller extends AbstractController {
103103
if (!generator) {
104104
promises.push(
105105
(async () => {
106-
generator = await this.walletRepositoryFactory()
106+
generator = (await this.walletRepositoryFactory()
107107
.createQueryBuilder()
108108
.select()
109109
.where("address = :address", { address: block.proposer })
110-
.getOneOrFail();
110+
.getOne()) ?? {
111+
address: block.proposer,
112+
attributes: {},
113+
balance: "0",
114+
nonce: "0",
115+
publicKey: "",
116+
updated_at: "0",
117+
};
111118
})(),
112119
);
113120
}

0 commit comments

Comments
 (0)