-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b86e46d
commit 97f789f
Showing
10 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
```k | ||
module MX-STORAGE-HOOKS | ||
imports MX-COMMON-SYNTAX | ||
imports MX-STORAGE-TOOLS-SYNTAX | ||
rule MX#storageLoad(mxStringValue(Key:String), Destination:MxValue ) | ||
=> storageLoad(getCallee(), Key, Destination) | ||
endmodule | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
```k | ||
module MX-STORAGE-TOOLS-SYNTAX | ||
imports MX-COMMON-SYNTAX | ||
imports STRING-SYNTAX | ||
syntax MxInstructions ::= storageLoad(address: String, key: String, destination: MxValue) | ||
endmodule | ||
module MX-STORAGE-TOOLS | ||
imports private COMMON-K-CELL | ||
imports private MX-ACCOUNTS-CONFIGURATION | ||
imports private MX-COMMON-SYNTAX | ||
imports private MX-STORAGE-TOOLS-SYNTAX | ||
imports private STRING-SYNTAX | ||
rule | ||
<k> | ||
storageLoad(... address: Address:String, key: _Key:String, destination: Destination:MxValue) | ||
=> storeHostValue(Destination, mxWrappedEmpty) | ||
... | ||
</k> | ||
<mx-account-address> Address </mx-account-address> | ||
[priority(100)] | ||
endmodule | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
addAccount("Owner"); | ||
setCallee("Owner"); | ||
setStorage("Owner", "MyKey", mxStringValue("Hello")); | ||
|
||
push mxIntValue(12); | ||
push mxStringValue("MyKey"); | ||
call 2 MX#storageLoad; | ||
push_store_data; | ||
check_eq mxIntValue(12); | ||
check_eq mxWrappedEmpty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
addAccount("Owner"); | ||
setCallee("Owner"); | ||
|
||
push mxIntValue(12); | ||
push mxStringValue("MyKey"); | ||
call 2 MX#storageLoad; | ||
push_store_data; | ||
check_eq mxIntValue(12); | ||
check_eq mxWrappedEmpty |