OSDN Git Service

delete amount checking for unlock statement (#37) master
authoroysheng <33340252+oysheng@users.noreply.github.com>
Tue, 17 Sep 2019 02:46:56 +0000 (10:46 +0800)
committerPaladz <yzhu101@uottawa.ca>
Tue, 17 Sep 2019 02:46:56 +0000 (10:46 +0800)
compiler/checks.go

index 0eda118..d8d3a2d 100644 (file)
@@ -414,7 +414,7 @@ func typeCheckStatement(stat statement, contractValue ValueInfo, clauseName stri
                if t := stmt.unlockedAsset.typ(env); t != assetType {
                        return fmt.Errorf("unlockedAsset expression \"%s\" in unlock statement of clause \"%s\" has type \"%s\", must be Asset", stmt.unlockedAsset, clauseName, t)
                }
-               if stmt.unlockedAmount.String() != contractValue.Amount || stmt.unlockedAsset.String() != contractValue.Asset {
+               if stmt.unlockedAsset.String() != contractValue.Asset {
                        return fmt.Errorf("amount \"%s\" of asset \"%s\" expression in unlock statement of clause \"%s\" must be the contract valueAmount \"%s\" of valueAsset \"%s\"",
                                stmt.unlockedAmount.String(), stmt.unlockedAsset.String(), clauseName, contractValue.Amount, contractValue.Asset)
                }