Skip to content

Commit

Permalink
Merge pull request #1340 from demergent-labs/result_fix
Browse files Browse the repository at this point in the history
fix results
  • Loading branch information
lastmjs authored Oct 4, 2023
2 parents 1ef40d3 + 747d114 commit dc4a35d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 1 addition & 7 deletions examples/ckbtc/wallet/backend/minter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/candid/serde/visitors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit dc4a35d

Please sign in to comment.