From dc26d71162aea0cd497c4e4fbb96c54e101e3fbe Mon Sep 17 00:00:00 2001 From: Kyle Peacock Date: Tue, 4 Jun 2024 15:49:11 -0700 Subject: [PATCH] cleaning up ts errors --- bin/update-management-idl.ts | 7 +++++-- packages/agent/src/actor.ts | 2 ++ packages/agent/src/canisters/management_idl.ts | 5 +---- packages/agent/src/canisters/management_service.ts | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/update-management-idl.ts b/bin/update-management-idl.ts index 664cce51..638255f8 100644 --- a/bin/update-management-idl.ts +++ b/bin/update-management-idl.ts @@ -28,8 +28,11 @@ fetch( // replace first line of service - ts.replace(`export interface _SERVICE {`, `export default interface _SERVICE {`); - js.replace(`export const idlFactory = ({ IDL }) => {`, `export default ({ IDL }) => {`); + ts = ts.replace(`export interface _SERVICE {`, `export default interface _SERVICE {`); + js = js.replace(`export const idlFactory = ({ IDL }) => {`, `export default ({ IDL }) => {`); + + // remove init function + js = js.split('export const init = ({ IDL }) => {')[0]; ts = prefix + ts; js = prefix + js; diff --git a/packages/agent/src/actor.ts b/packages/agent/src/actor.ts index e221775c..cc4193ea 100644 --- a/packages/agent/src/actor.ts +++ b/packages/agent/src/actor.ts @@ -278,6 +278,8 @@ export class Actor { compute_allocation: settings.compute_allocation ? [settings.compute_allocation] : [], freezing_threshold: settings.freezing_threshold ? [settings.freezing_threshold] : [], memory_allocation: settings.memory_allocation ? [settings.memory_allocation] : [], + reserved_cycles_limit: [], + log_visibility: [], }, ]; } diff --git a/packages/agent/src/canisters/management_idl.ts b/packages/agent/src/canisters/management_idl.ts index d1cd62a5..aaf376a2 100644 --- a/packages/agent/src/canisters/management_idl.ts +++ b/packages/agent/src/canisters/management_idl.ts @@ -5,7 +5,7 @@ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore -export const idlFactory = ({ IDL }) => { +export default ({ IDL }) => { const bitcoin_network = IDL.Variant({ mainnet: IDL.Null, testnet: IDL.Null, @@ -347,6 +347,3 @@ export const idlFactory = ({ IDL }) => { upload_chunk: IDL.Func([upload_chunk_args], [upload_chunk_result], []), }); }; -export const init = ({ IDL }) => { - return []; -}; diff --git a/packages/agent/src/canisters/management_service.ts b/packages/agent/src/canisters/management_service.ts index 0f96933e..10041ac2 100644 --- a/packages/agent/src/canisters/management_service.ts +++ b/packages/agent/src/canisters/management_service.ts @@ -283,7 +283,7 @@ export interface utxo { outpoint: outpoint; } export type wasm_module = Uint8Array | number[]; -export interface _SERVICE { +export default interface _SERVICE { bitcoin_get_balance: ActorMethod<[bitcoin_get_balance_args], bitcoin_get_balance_result>; bitcoin_get_balance_query: ActorMethod< [bitcoin_get_balance_query_args],