-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make all HelloWorld resources have the same kind (#25)
* Set webpack config to production * Wrap the result of fetchBinary in a Uint8Array * Make all HelloWorld resources have the same kind The HelloWorld message is now stored in the value instead of the label. Messages are retrieved using the `filterKind` endpoint of the BlockService * Add filterKind API to AnomaClient * Use the filter kind method in the HelloWorld webapp * Fix HelloWorld test script * Restore catch handler * Add comment to explain dummyResource
- Loading branch information
1 parent
f9230d1
commit 6132630
Showing
10 changed files
with
154 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module AppIdentity; | ||
|
||
import Stdlib.Prelude open; | ||
import Applib open; | ||
|
||
--- The label for HelloWorld resources | ||
label : Nat := builtinAnomaEncode "HelloWorld"; | ||
|
||
--- Compute the kind of the HelloWorld ;Resource; | ||
main (encodedLogic : Encoded Logic) : Kind := | ||
let | ||
logic := Encode.decode encodedLogic; | ||
-- Only the logic and label are used in the kind computation, we can use | ||
-- default values for other fields. | ||
dummyResource : Resource := | ||
mkResource@{ | ||
label; | ||
logic; | ||
value := 0; | ||
quantity := 0; | ||
nonce := 0; | ||
ephemeral := true; | ||
randSeed := 0; | ||
nullifierKeyCommitment := 0; | ||
}; | ||
in kind dummyResource; |
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,18 @@ | ||
module Logic; | ||
|
||
import Stdlib.Prelude open; | ||
import Applib open; | ||
|
||
--- A logic function that is always valid. | ||
logic (publicInputs : Instance) (privateInputs : Witness) : Bool := true; | ||
|
||
type LogicWrapper := | ||
mkLogicWrapper@{ | ||
logic : Logic; | ||
}; | ||
|
||
--- Compute the logic function for the HelloWorld ;Resource; | ||
main : LogicWrapper := | ||
mkLogicWrapper@{ | ||
logic; | ||
}; |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
-e | ||
set -e | ||
|
||
pushd message | ||
./tests.sh | ||
./test.sh | ||
popd | ||
|
||
echo "All HelloWorld tests passed" |
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 |
---|---|---|
|
@@ -26,5 +26,5 @@ module.exports = { | |
}, | ||
], | ||
}, | ||
mode: 'development' | ||
mode: 'production' | ||
}; |
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