Skip to content

Commit

Permalink
Update to dtx 19. Expose get_state. Fix canister response in stats.
Browse files Browse the repository at this point in the history
  • Loading branch information
panindustrial-dev committed Apr 13, 2024
1 parent 71f19a2 commit eb0d0f9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@
"subnet_type": "application"
}
},
"dfx": "0.18.0",
"dfx": "0.19.0",
"version": 1
}
2 changes: 1 addition & 1 deletion mops.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "icrc3-mo"
version = "0.2.4"
version = "0.2.5"
description = "icrc3 for motoko"
repository = "https://github.com/PanIndustrial-Org/icrc3.mo"
keywords = [ "ledger", "transactions", "log" ]
Expand Down
14 changes: 13 additions & 1 deletion src/lib.mo
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ module {
};
};



/// The migrate function
public let migrate = Migration.migrate;

Expand Down Expand Up @@ -640,7 +642,7 @@ module {
lastIndex = state.lastIndex;
firstIndex = state.firstIndex;
archives = Iter.toArray(Map.entries<Principal, TransactionRange>(state.archives));
ledgerCanister = state.ledgerCanister;
ledgerCanister = canister;
supportedBlocks = Iter.toArray<BlockType>(Vec.vals(state.supportedBlocks));
bCleaning = state.bCleaning;
constants = {
Expand All @@ -656,6 +658,16 @@ module {
};
};

/// Returns the statistics of the migration
///
/// This function returns the statistics of the migration.
///
/// Returns:
/// - The migration statistics
public func get_state() : CurrentState {
return state;
};

///Returns an array of supported block types.
///
/// @returns {Array<BlockType>} The array of supported block types.
Expand Down

0 comments on commit eb0d0f9

Please sign in to comment.