Skip to content

Commit

Permalink
cleaning up ts errors
Browse files Browse the repository at this point in the history
  • Loading branch information
krpeacock committed Jun 4, 2024
1 parent 883091a commit dc26d71
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
7 changes: 5 additions & 2 deletions bin/update-management-idl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions packages/agent/src/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [],
},
];
}
Expand Down
5 changes: 1 addition & 4 deletions packages/agent/src/canisters/management_idl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -347,6 +347,3 @@ export const idlFactory = ({ IDL }) => {
upload_chunk: IDL.Func([upload_chunk_args], [upload_chunk_result], []),
});
};
export const init = ({ IDL }) => {
return [];
};
2 changes: 1 addition & 1 deletion packages/agent/src/canisters/management_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit dc26d71

Please sign in to comment.