diff --git a/CHANGELOG.md b/CHANGELOG.md index 2475578c..9a94781d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ that can be found in the LICENSE file. --> # Changelog +## 1.0.0-dev.32 + +- Make parsable big number string as covariant of Fixed classes. + ## 1.0.0-dev.31 - Treat parsable big number string as a covariant of the `Nat` class. diff --git a/packages/agent_dart/pubspec.yaml b/packages/agent_dart/pubspec.yaml index dddacd9f..7058f19e 100644 --- a/packages/agent_dart/pubspec.yaml +++ b/packages/agent_dart/pubspec.yaml @@ -1,5 +1,5 @@ name: agent_dart -version: 1.0.0-dev.31 +version: 1.0.0-dev.32 description: | An agent library built for Internet Computer, diff --git a/packages/agent_dart_base/lib/candid/idl.dart b/packages/agent_dart_base/lib/candid/idl.dart index 075845e8..779ce55e 100644 --- a/packages/agent_dart_base/lib/candid/idl.dart +++ b/packages/agent_dart_base/lib/candid/idl.dart @@ -636,6 +636,9 @@ class FixedIntClass extends PrimitiveType { } else if (x is int) { final v = BigInt.from(x); return v >= min && v <= max; + } else if (x is String && BigInt.tryParse(x) != null) { + final v = BigInt.parse(x); + return v >= min && v <= max; } else { return false; } @@ -696,6 +699,11 @@ class FixedNatClass extends PrimitiveType { } else if (x is int && x >= 0) { final v = BigInt.from(x); return v < max; + } else if (x is String && + BigInt.tryParse(x) != null && + BigInt.parse(x) >= BigInt.zero) { + final v = BigInt.parse(x); + return v < max; } else { return false; } diff --git a/packages/agent_dart_base/pubspec.yaml b/packages/agent_dart_base/pubspec.yaml index 4bc385d8..7efc1494 100644 --- a/packages/agent_dart_base/pubspec.yaml +++ b/packages/agent_dart_base/pubspec.yaml @@ -1,5 +1,5 @@ name: agent_dart_base -version: 1.0.0-dev.31 +version: 1.0.0-dev.32 description: The Dart plugin that bridges Rust implementation for agent_dart. repository: https://github.com/AstroxNetwork/agent_dart diff --git a/packages/agent_dart_ffi/pubspec.yaml b/packages/agent_dart_ffi/pubspec.yaml index cc7c35fb..5401f0af 100644 --- a/packages/agent_dart_ffi/pubspec.yaml +++ b/packages/agent_dart_ffi/pubspec.yaml @@ -1,5 +1,5 @@ name: agent_dart_ffi -version: 1.0.0-dev.31 +version: 1.0.0-dev.32 description: The FFI plugin that bridges Rust implementation for agent_dart. repository: https://github.com/AstroxNetwork/agent_dart