From d657628bdfd93c8ea0ec97141ba70bcaa588f989 Mon Sep 17 00:00:00 2001 From: Teng Zhang Date: Sun, 4 Jun 2023 10:29:21 -0700 Subject: [PATCH] fix coin spec --- aptos-move/framework/aptos-framework/doc/coin.md | 6 ++++-- aptos-move/framework/aptos-framework/sources/coin.spec.move | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/aptos-move/framework/aptos-framework/doc/coin.md b/aptos-move/framework/aptos-framework/doc/coin.md index 12c1cea63524f3..1dc3bd18f4d2b0 100644 --- a/aptos-move/framework/aptos-framework/doc/coin.md +++ b/aptos-move/framework/aptos-framework/doc/coin.md @@ -1889,8 +1889,10 @@ Destroy a burn capability.
schema TotalSupplyTracked<CoinType> {
-    invariant spec_fun_supply_tracked<CoinType>(supply<CoinType> + aggregate_supply<CoinType>,
-                global<CoinInfo<CoinType>>(type_info::type_of<CoinType>().account_address).supply);
+    ensures old(spec_fun_supply_tracked<CoinType>(supply<CoinType> + aggregate_supply<CoinType>,
+        global<CoinInfo<CoinType>>(type_info::type_of<CoinType>().account_address).supply)) ==>
+        spec_fun_supply_tracked<CoinType>(supply<CoinType> + aggregate_supply<CoinType>,
+            global<CoinInfo<CoinType>>(type_info::type_of<CoinType>().account_address).supply);
 }
 
diff --git a/aptos-move/framework/aptos-framework/sources/coin.spec.move b/aptos-move/framework/aptos-framework/sources/coin.spec.move index 0aea237d0ced40..da2e8a308f38de 100644 --- a/aptos-move/framework/aptos-framework/sources/coin.spec.move +++ b/aptos-move/framework/aptos-framework/sources/coin.spec.move @@ -15,8 +15,10 @@ spec aptos_framework::coin { } spec schema TotalSupplyTracked { - invariant spec_fun_supply_tracked(supply + aggregate_supply, - global>(type_info::type_of().account_address).supply); + ensures old(spec_fun_supply_tracked(supply + aggregate_supply, + global>(type_info::type_of().account_address).supply)) ==> + spec_fun_supply_tracked(supply + aggregate_supply, + global>(type_info::type_of().account_address).supply); } spec fun spec_fun_supply_no_change(old_supply: Option,