Skip to content

Commit

Permalink
Bit of documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rpanic committed Mar 4, 2024
1 parent bfb7c87 commit 4781cf6
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 23 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@
"unicorn/prefer-event-target": "off",
"putout/putout": "off",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "off",
"no-undef-init": "off"
"no-undef-init": "off",
"@typescript-eslint/sort-type-constituents": "off"
},

"overrides": [
Expand Down
8 changes: 8 additions & 0 deletions packages/protocol/src/settlement/ContractModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ import { SmartContract } from "o1js";
export type SmartContractClassFromInterface<Type> = typeof SmartContract &
TypedClass<Type>;

/**
* This module type is used to define a contract module that can be used to
* construct and inject smart contract instances.
* It defines a method contractFactory, whose arguments can be configured via
* the Argument generic. It returns a smart contract class that is a subclass
* of SmartContract and implements a certain interface as specified by the
* ContractType generic.
*/
export abstract class ContractModule<
ContractType,
// no args
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export type TransactionTaskResult = {
transaction: Mina.Transaction;
};

/**
* Implementation of a task to prove any Mina transaction.
* Account state is configurable via the task args
*/
@injectable()
@scoped(Lifecycle.ContainerScoped)
export class SettlementProvingTask
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { uniqBy } from "lodash";
import {
AccountUpdate,
addCachedAccount,
Expand All @@ -14,7 +13,7 @@ import {
import { ReturnType } from "@proto-kit/protocol";
import { match } from "ts-pattern";
import { inject, injectable } from "tsyringe";
import { distinct, distinctByPredicate } from "../../helpers/utils";
import { distinctByPredicate } from "../../helpers/utils";

import type { MinaBaseLayer } from "../../protocol/baselayer/MinaBaseLayer";

Expand All @@ -24,14 +23,14 @@ type FeePayer = Mina.Transaction["transaction"]["feePayer"];

@injectable()
export class MinaTransactionSimulator {
public constructor(
@inject("BaseLayer") private readonly baseLayer: MinaBaseLayer
) {}

private local = this.baseLayer.config.network.local;

private loaded: Record<string, Account | null> = {};

public constructor(
@inject("BaseLayer") private readonly baseLayer: MinaBaseLayer
) {}

private async fetchGraphql<Type>(
f: () => Promise<Type>
): Promise<Type | undefined> {
Expand Down
16 changes: 0 additions & 16 deletions packages/sequencer/test/settlement/Settlement.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,6 @@ import { testingSequencerFromModules } from "../TestingSequencer";

log.setLevel("DEBUG");

describe("Test", () => {
it("", async () => {
class S1 extends SmartContract {
@method
public do() {
Field(1).equals(1);
}
}

class S2 extends S1 {}

const methods = S2.analyzeMethods();
console.log();
});
});

describe("settlement contracts", () => {
let localInstance: ReturnType<typeof Mina.LocalBlockchain>;

Expand Down

0 comments on commit 4781cf6

Please sign in to comment.