Skip to content

Commit

Permalink
ignore warning
Browse files Browse the repository at this point in the history
  • Loading branch information
zamrokk committed Aug 11, 2023
1 parent eb79870 commit 3becec5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 31 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ Let's modify poke functions now
@entry
const poke = (_: parameter, store: storage): return_ => {
const { pokeTraces, feedback, ticketOwnership } = store;
ignore(feedback);
const [t, tom]: [option<ticket<string>>, map<address, ticket<string>>] =
Map.get_and_update(
Tezos.get_source(),
Expand Down Expand Up @@ -223,7 +224,7 @@ Compile the contract to check any errors
```bash
npm i

TAQ_LIGO_IMAGE=ligolang/ligo:0.71.0 taq compile pokeGame.jsligo
TAQ_LIGO_IMAGE=ligolang/ligo:0.71.1 taq compile pokeGame.jsligo
```

Check on logs that everything is fine :ok_hand:
Expand Down
38 changes: 19 additions & 19 deletions solution/.taq/development-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,6 @@
}
]
},
"@taqueria/plugin-ligo.compile.1691398149037": {
"task": "compile",
"plugin": "@taqueria/plugin-ligo",
"time": 1691398149037,
"output": [
{
"contract": "pokeGame.jsligo",
"artifact": "artifacts/pokeGame.tz"
},
{
"contract": "pokeGame.storageList.jsligo",
"artifact": "artifacts/pokeGame.default_storage.tz\n"
},
{
"contract": "pokeGame.parameterList.jsligo",
"artifact": "No parameter expressions found\n"
}
]
},
"@taqueria/plugin-ligo.compile.1691399275158": {
"task": "compile",
"plugin": "@taqueria/plugin-ligo",
Expand Down Expand Up @@ -142,6 +123,25 @@
"artifact": "No parameter expressions found\n"
}
]
},
"@taqueria/plugin-ligo.compile.1691763895702": {
"task": "compile",
"plugin": "@taqueria/plugin-ligo",
"time": 1691763895702,
"output": [
{
"contract": "pokeGame.jsligo",
"artifact": "artifacts/pokeGame.tz"
},
{
"contract": "pokeGame.storageList.jsligo",
"artifact": "artifacts/pokeGame.default_storage.tz\n"
},
{
"contract": "pokeGame.parameterList.jsligo",
"artifact": "No parameter expressions found\n"
}
]
}
}
}
2 changes: 1 addition & 1 deletion solution/.taq/state.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// WARNING: This file is autogenerated and should NOT be modified
{
"build": "6a57340",
"configHash": "dd7572ce45e4bcf5962c862fb47c5fcd9300a69f13b809d7c45b5cf3b4c05d6c",
"configHash": "80e4352723c870e4fd434d2ffb0deb44fa8c47af3952caa6b023696a13a9883a",
"tasks": {
"ligo": {
"type": "npm",
Expand Down
21 changes: 11 additions & 10 deletions solution/contracts/pokeGame.jsligo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
type pokeMessage = {
receiver : address,
feedback : string
receiver: address,
feedback: string
};

export type storage = {
Expand All @@ -9,16 +9,15 @@ export type storage = {
ticketOwnership: map<address, ticket<string>> //ticket of claims
};

type returned_feedback = [address, string]; //address that gives feedback and a string message
type returned_feedback = [address, string];

type oracle_param = contract<returned_feedback>;


type parameter = unit;

type return_ = [list<operation>, storage];

@entry
@entry
const poke = (_: parameter, store: storage): return_ => {
const { pokeTraces, feedback, ticketOwnership } = store;
const [t, tom]: [option<ticket<string>>, map<address, ticket<string>>] =
Expand Down Expand Up @@ -59,10 +58,11 @@ const getFeedback = (contract_callback : contract<returned_feedback>, store : st
};
*/

@no_mutation
@entry
@no_mutation
@entry
const pokeAndGetFeedback = (oracleAddress: address, store: storage): return_ => {
const { pokeTraces, feedback, ticketOwnership } = store;
ignore(feedback);
const [t, tom]: [option<ticket<string>>, map<address, ticket<string>>] =
Map.get_and_update(
Tezos.get_source(),
Expand Down Expand Up @@ -103,7 +103,6 @@ const pokeAndGetFeedback = (oracleAddress: address, store: storage): return_ =>
)
};


/*
@entry
const pokeAndGetFeedbackCallback = (feedback : returned_feedback, store : storage) : return_ => {
Expand All @@ -114,7 +113,9 @@ const pokeAndGetFeedbackCallback = (feedback : returned_feedback, store : storag
*/

@view
const feedback = ([_, store] : [unit, storage]) : string => { return store.feedback };
const feedback = ([_, store]: [unit, storage]): string => {
return store.feedback
};

@entry
const init = ([a, ticketCount]: [address, nat], store: storage): return_ => {
Expand All @@ -132,4 +133,4 @@ const init = ([a, ticketCount]: [address, nat], store: storage): return_ => {
{ pokeTraces, feedback, ticketOwnership: Map.add(a, t, ticketOwnership) }
]
}
};
};

0 comments on commit 3becec5

Please sign in to comment.