Skip to content

Commit

Permalink
chore: WIP:: Thinking about creating a base types module for each mod…
Browse files Browse the repository at this point in the history
…ule under the client.
  • Loading branch information
Mahmoud-Emad committed Jun 25, 2024
1 parent af86453 commit 5984fcf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/grid_client/scripts/add_node_to_network.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { NetworkAddNodeModel } from "../src";
import { GridClient, NetworkAddNodeModel } from "../src";
import { getClient } from "./client_loader";
import { log } from "./utils";

async function addNode(client, node) {
async function addNode(client: GridClient, node: NetworkAddNodeModel) {
const res = await client.networks.addNode(node);
log("================= Adding node =================");
log(res);
log("================= Adding node =================");
}

async function main() {
const grid3 = await getClient();
const grid3: GridClient = await getClient();
const node: NetworkAddNodeModel = {
name: "wedtest",
ipRange: "10.249.0.0/16",
Expand Down
14 changes: 13 additions & 1 deletion packages/grid_client/src/modules/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ import { BaseModule } from "./base";
import { NetworkAddNodeModel, NetworkGetModel, NetworkHasNodeModel } from "./models";
import { checkBalance } from "./utils";

interface INetworkModule {
addNode: {
contracts: {};
};
}

class NetworkModuleResult implements INetworkModule {
addNode: {
contracts: {};
};
}

class NetworkModule extends BaseModule {
moduleName = "networks";
network: NetworkHL;
Expand All @@ -20,7 +32,7 @@ class NetworkModule extends BaseModule {
@expose
@validateInput
@checkBalance
async addNode(options: NetworkAddNodeModel) {
async addNode(options: NetworkAddNodeModel): Promise<{}> {
const twinDeployments = await this.network.addNode(
options.name,
options.ipRange,
Expand Down
Empty file.
Empty file.

0 comments on commit 5984fcf

Please sign in to comment.