diff --git a/examples/ckbtc/wallet/backend/minter.ts b/examples/ckbtc/wallet/backend/minter.ts index a4a76f1207..d6b46d1cfa 100644 --- a/examples/ckbtc/wallet/backend/minter.ts +++ b/examples/ckbtc/wallet/backend/minter.ts @@ -57,13 +57,7 @@ const UpdateBalanceError = Variant({ GenericError: Record({ error_message: text, error_code: nat64 }) }); -// TODO: For some reason Result doesn't work. -// See https://github.com/demergent-labs/azle/issues/1335 -// export const UpdateBalanceResult = Result(Vec(UtxoStatus), UpdateBalanceError); -export const UpdateBalanceResult = Variant({ - Ok: Vec(UtxoStatus), - Err: UpdateBalanceError -}); +export const UpdateBalanceResult = Result(Vec(UtxoStatus), UpdateBalanceError); export const Minter = Canister({ get_btc_address: update( diff --git a/src/lib/candid/serde/visitors/index.ts b/src/lib/candid/serde/visitors/index.ts index 3b2150e865..70d24469b3 100644 --- a/src/lib/candid/serde/visitors/index.ts +++ b/src/lib/candid/serde/visitors/index.ts @@ -93,7 +93,7 @@ export function visitVariant( ); } if ('Err' in data.js_data) { - const errField = fields[0]; + const errField = fields[1]; const errData = data.js_data['Err']; const errClass = data.candidType._azleErr; return Result.Err(