Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to v1 #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ indice.json: src/indice/main.mligo
advisor.tz: src/advisor/main.mligo
@mkdir -p compiled
@echo "Compiling Advisor smart contract to Michelson"
@$(ligo_compiler) compile contract $^ -e advisorMain $(protocol_opt) > compiled/$@
@$(ligo_compiler) compile contract $^ $(protocol_opt) > compiled/$@

advisor.json: src/advisor/main.mligo
@mkdir -p compiled
@echo "Compiling Advisor smart contract to Michelson in JSON format"
@$(ligo_compiler) compile contract $^ $(JSON_OPT) -e advisorMain $(protocol_opt) > compiled/$@
@$(ligo_compiler) compile contract $^ $(JSON_OPT) $(protocol_opt) > compiled/$@

clean:
@echo "Removing Michelson files"
Expand Down
3 changes: 2 additions & 1 deletion src/advisor/main.mligo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ type storage = Storage.Types.t
type parameter = Parameter.Types.t
type return = operation list * storage

let advisorMain(ep, store : Parameter.Types.t * Storage.Types.t) : return =
[@entry]
let advisorMain (ep : Parameter.Types.t) (store : Storage.Types.t) : return =
([] : operation list), (match ep with
| ChangeAlgorithm(p) -> Storage.Utils.change(p, store)
| ExecuteAlgorithm(_p) -> Storage.Utils.executeAlgorithm(store)
Expand Down
6 changes: 4 additions & 2 deletions src/indice/main.mligo
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ let increment(param, store : int * storage) : return =
let decrement(param, store : int * storage) : return =
(([]: operation list), store - param)

let indiceMain(ep, store : parameter * storage) : return =
[@entry]
let indiceMain (ep : parameter) (store : storage) : return =
match ep with
| Increment(p) -> increment(p, store)
| Decrement(p) -> decrement(p, store)

[@view] let indice_value(_params, store: unit * storage): int = store
[@view]
let indice_value (_params : unit) (store: storage) : int = store