Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix eslint leftovers after PR merging #137

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Field, ObjectType, Query } from "type-graphql";
import { ChildContainerProvider } from "@proto-kit/common";

import { graphqlModule, GraphqlModule } from "../GraphqlModule";
import {
NodeInformation,
NodeStatusService,
ProcessInformation,
} from "../services/NodeStatusService";

import { NodeInformationObject } from "./NodeStatusResolver";

@ObjectType()
Expand Down
8 changes: 4 additions & 4 deletions packages/api/src/graphql/services/NodeStatusService.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import * as process from "node:process";

import { inject, injectable } from "tsyringe";
import {
BlockStorage,
SettlementStorage,
UnprovenBlockStorage,
} from "@proto-kit/sequencer";

import humanizeDuration from "humanize-duration";
import * as process from "node:process";

export interface ProcessInformation {
uptime: number;
Expand Down Expand Up @@ -39,8 +39,8 @@ export class NodeStatusService {

const memory = process.memoryUsage();
const nodeVersion = process.version;
const arch = process.arch;
const platform = process.platform;
const { arch } = process;
const { platform } = process;

return {
uptime,
Expand Down
14 changes: 6 additions & 8 deletions packages/library/src/runtime/Withdrawals.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { runtimeModule, RuntimeModule, state } from "@proto-kit/module";
import { State, StateMap, Withdrawal } from "@proto-kit/protocol";
import { Field, PublicKey, Mina } from "o1js";
import { Field, PublicKey } from "o1js";
import { inject } from "tsyringe";

import { UInt64 } from "../math/UInt64";
Expand All @@ -17,20 +17,18 @@ export class Withdrawals extends RuntimeModule {
super();
}

protected queueWithdrawal(withdrawal: Withdrawal) {
const counter = this.withdrawalCounter.get().orElse(Field(0));
protected async queueWithdrawal(withdrawal: Withdrawal) {
const counter = (await this.withdrawalCounter.get()).orElse(Field(0));

this.withdrawals.set(counter, withdrawal);

this.withdrawalCounter.set(counter.add(1));
}

public withdraw(address: PublicKey, amount: UInt64) {
const balance = this.balances.getBalance(TokenId.from(0), address);
public async withdraw(address: PublicKey, amount: UInt64) {
const balance = await this.balances.getBalance(TokenId.from(0), address);

const accountCreationFee = UInt64.Unsafe.fromField(
Mina.accountCreationFee().value.toConstant()
);
const accountCreationFee = UInt64.Unsafe.fromField(Field(1n).mul(1e9));
amount.assertGreaterThanOrEqual(
accountCreationFee,
"Minimum withdrawal amount not met"
Expand Down
Loading