Skip to content

Commit

Permalink
Value + MultiAsset(/Mint) custom code
Browse files Browse the repository at this point in the history
Based on old CML's Value / MultiAsset classes.

AssetBundle generalizes MultiAsset/Mint to work on any integer-like
value type.

Includes both checked and clamp operations, with the clamping/checking
applied uniformly to both the AssetBundle and Coin for Value, a
difference from the old Value where both used clamping operation for the
MultiAsset part.

Value was very lightly hand-edited to match closer the old format,
although without the multiasset part being an Option. This required one
extra field for ValueEncoding to differentiate between a coin-only Value
and one using the multiasset format but without any assets (e.g. empty
map).

Only includes the rust API. Once this is finalized we can work on the
wasm API.
  • Loading branch information
rooooooooob committed Mar 22, 2023
1 parent f87bdd9 commit c21cdc5
Show file tree
Hide file tree
Showing 9 changed files with 629 additions and 284 deletions.
1 change: 1 addition & 0 deletions chain/rust/Cargo.toml
Expand Up @@ -28,6 +28,7 @@ num-bigint = "0.4.0"
num-integer = "0.1.45"
#rand_os = "0.1"
thiserror = "1.0.37"
num = "0.4"
# These can be removed if we make wasm bindings for ALL functionality here.
# This was not done right now as there is a lot of existing legacy code e.g.
# for Byron that might need to be used from WASM and might not.
Expand Down

0 comments on commit c21cdc5

Please sign in to comment.