Skip to content

Commit

Permalink
fix: Fix the build workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mahmoud-Emad committed Jun 27, 2024
1 parent c714dd3 commit 897b294
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/grid_client/src/high_level/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class NetworkHL extends HighLevelBase {
} else {
const path = PATH.join(this.config.storePath, "networks", networkName, "info.json");
const networkInfo = await this.backendStorage.load(path);
return networkInfo["wireguardConfigs"] || [];
return (networkInfo["wireguardConfigs"] as unknown as string[]) || ([] as string[]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/src/modules/machines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class MachinesModule extends BaseModule {
@expose
@validateInput
@checkBalance
async delete(options: MachinesDeleteModel): Promise<{ created: never[]; deleted: never[]; updated: never[] }> {
async delete(options: MachinesDeleteModel) {
events.emit("logs", `Start deleting the machine deployment with name ${options.name}`);
return await this._delete(options.name);
}
Expand Down
13 changes: 9 additions & 4 deletions packages/grid_client/src/modules/stellar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Stellar implements blockchainInterface {
if (data[name]) {
throw new ValidationError(`A wallet with the same name ${name} already exists.`);
}
const updateOperations = await this.backendStorage.update(path, name, secret);
const updateOperations = await this.backendStorage.update(path as string, name, secret);
await this.saveIfKVStoreBackend(updateOperations);
}

Expand Down Expand Up @@ -177,7 +177,7 @@ class Stellar implements blockchainInterface {
@validateInput
async list(): Promise<BlockchainListResultModel[]> {
const [, data] = await this._load();
const accounts = [];
const accounts: BlockchainListResultModel[] = [];

for (const [name, secret] of Object.entries(data)) {
accounts.push({
Expand Down Expand Up @@ -216,7 +216,7 @@ class Stellar implements blockchainInterface {
@validateInput
async balance_by_address(options: StellarWalletBalanceByAddressModel): Promise<BlockchainAssetModel[]> {
const account = await server.loadAccount(options.address);
const balances = [];
const balances: BlockchainAssetModel[] = [];
for (const balance of account.balances) {
if (!balance.asset_code) {
balance.asset_code = "XLM";
Expand Down Expand Up @@ -288,7 +288,12 @@ class Stellar implements blockchainInterface {
if (!data[options.name]) {
throw new ValidationError(`Couldn't find a wallet with name ${options.name}.`);
}
const updateOperations = await this.backendStorage.update(path, options.name, "", StorageUpdateAction.delete);
const updateOperations = await this.backendStorage.update(
path as string,
options.name,
"",
StorageUpdateAction.delete,
);
await this.saveIfKVStoreBackend(updateOperations);
return "Deleted";
}
Expand Down
2 changes: 1 addition & 1 deletion packages/grid_client/src/modules/tfchain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class TFChain implements blockchainInterface {
if (data[name]) {
throw new ValidationError(`An account with the same name ${name} already exists.`);
}
const updateOperations = await this.backendStorage.update(path, name, mnemonic);
const updateOperations = await this.backendStorage.update(path as string, name, mnemonic);
await this.saveIfKVStoreBackend(updateOperations);
}

Expand Down
4 changes: 2 additions & 2 deletions packages/grid_client/src/storage/backend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class BackendStorage {
* @param key The key of the value to be loaded.
* @returns A promise that resolves with an object representing the value stored under the key.
*/
async load(key: string): Promise<Record<string, string>> {
async load(key: string): Promise<Record<string, any>> {
const data = await this.storage.get(key);
return JSON.parse(data.toString());
}
Expand Down Expand Up @@ -119,7 +119,7 @@ class BackendStorage {
* @param value The value to be stored, in the form of a key-value pair object.
* @returns A promise that resolves after saving the value in the storage.
*/
async dump(key: string, value: Record<string, string>) {
async dump(key: string, value: any) {
return await this.storage.set(key, JSON.stringify(value));
}

Expand Down

0 comments on commit 897b294

Please sign in to comment.