Skip to content

Commit

Permalink
Merge pull request #137 from proto-kit/feature/eslint-postmortem
Browse files Browse the repository at this point in the history
fix eslint leftovers after PR merging
  • Loading branch information
rpanic authored Jun 25, 2024
2 parents 2ee159c + 0007de6 commit b58a524
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
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

0 comments on commit b58a524

Please sign in to comment.