diff --git a/src/frontend/src/pages/Chapters/Camel/ChapterPolymorphism/course.md b/src/frontend/src/pages/Chapters/Camel/ChapterPolymorphism/course.md index 85be6c4..07862b4 100644 --- a/src/frontend/src/pages/Chapters/Camel/ChapterPolymorphism/course.md +++ b/src/frontend/src/pages/Chapters/Camel/ChapterPolymorphism/course.md @@ -29,7 +29,7 @@ The problem is coming from the fact that _B_ must know the whole definition of _ The predefined function *Tezos.get\_entrypoint\_opt* has the following syntax : ``` -let : option(contract()) = Tezos.get_entrypoint_opt(, ); +let : contract option = Tezos.get_entrypoint_opt in ``` When the function *get\_entrypoint\_opt* does not find any contract at a given _address_ or the contract doesn't match the type, then _None_ is returned. @@ -53,10 +53,10 @@ The Squadron contract provides an entry point _ModuleResponse_ which is called b As you can see, the entry point _RetrieveShip_ calls the function _sendTx_ which is responsible to send a transaction to a the calling contract. The implementation of the Central contract has not been finished. We need you to finish the _sendTx_ function! -1- Try to retrieve the entry point %moduleResponse of the given *callbackAddress* and store the result in a variable called *contractInterfaceOpt* of type _option(contract(actionSquadron))_ +1- Try to retrieve the entry point %moduleResponse of the given *callbackAddress* and store the result in a variable called *contractInterfaceOpt* of type _actionSquadron contract option_ -2- Use a _switch_ operator to extract the entry point if it exists (use temporary variable name *ci* in the switch). Otherwise throw an exception with error message "Entrypoint not found in contract Squadron". The extracted entry point must be stored in a variable called *contractInterface*. +2- Use a _match_ operator to extract the entry point if it exists (use temporary variable name *ci* in the _Some_). Otherwise throw an exception with error message "Entrypoint not found in contract Squadron" (and don't forget to cast the exception in the right type). The extracted entry point must be stored in a variable called *contractInterface*. -3- In order to prepare the ship information that need to be sent back to the Squadron contract. Check the expected type of entry point _moduleResponse_ and prepare a variable *ee* containing the expected ship *e*. +3- In order to prepare the ship information that need to be sent back to the Squadron contract. Check the expected type of entry point _ModuleResponse_ and prepare a variable *ee* of this expected type containing the expected ship *e*. 4- Send a transaction to the retrieved entry point of the Squadron contract. The transaction must point to the _moduleResponse_ entrypoint of squadron contract and passing the right argument prepared in step 3. This transaction sends no money. The transaction is an _operation_ type that you can store in a variable *sendbackOperation*. diff --git a/src/frontend/src/pages/Chapters/Pascal/ChapterPolymorphism/central_solution.ligo b/src/frontend/src/pages/Chapters/Pascal/ChapterPolymorphism/central_solution.ligo index 576536b..3640a67 100644 --- a/src/frontend/src/pages/Chapters/Pascal/ChapterPolymorphism/central_solution.ligo +++ b/src/frontend/src/pages/Chapters/Pascal/ChapterPolymorphism/central_solution.ligo @@ -27,7 +27,7 @@ begin const ee : actionModuleResponse = record e = e end; - const sendbackOperation: operation = transaction(ModuleResponse(ee), 0mutez, contractInterface); + const sendbackOperation: operation = Tezos.transaction(ModuleResponse(ee), 0mutez, contractInterface); const listoperation : list(operation) = list sendbackOperation diff --git a/src/frontend/src/pages/Chapters/Pascal/ChapterPolymorphism/course.md b/src/frontend/src/pages/Chapters/Pascal/ChapterPolymorphism/course.md index 85be6c4..60f578d 100644 --- a/src/frontend/src/pages/Chapters/Pascal/ChapterPolymorphism/course.md +++ b/src/frontend/src/pages/Chapters/Pascal/ChapterPolymorphism/course.md @@ -29,7 +29,7 @@ The problem is coming from the fact that _B_ must know the whole definition of _ The predefined function *Tezos.get\_entrypoint\_opt* has the following syntax : ``` -let : option(contract()) = Tezos.get_entrypoint_opt(, ); +const : option(contract()) = Tezos.get_entrypoint_opt(, ); ``` When the function *get\_entrypoint\_opt* does not find any contract at a given _address_ or the contract doesn't match the type, then _None_ is returned. @@ -55,8 +55,8 @@ As you can see, the entry point _RetrieveShip_ calls the function _sendTx_ which 1- Try to retrieve the entry point %moduleResponse of the given *callbackAddress* and store the result in a variable called *contractInterfaceOpt* of type _option(contract(actionSquadron))_ -2- Use a _switch_ operator to extract the entry point if it exists (use temporary variable name *ci* in the switch). Otherwise throw an exception with error message "Entrypoint not found in contract Squadron". The extracted entry point must be stored in a variable called *contractInterface*. +2- Use a _case_ operator to extract the entry point if it exists (use temporary variable name *ci* in the case). Otherwise throw an exception with error message "Entrypoint not found in contract Squadron" (and don't forget to cast the exception in the right type). The extracted entry point must be stored in a variable called *contractInterface*. -3- In order to prepare the ship information that need to be sent back to the Squadron contract. Check the expected type of entry point _moduleResponse_ and prepare a variable *ee* containing the expected ship *e*. +3- In order to prepare the ship information that need to be sent back to the Squadron contract. Check the expected type of entry point _ModuleResponse_ and prepare a variable *ee* of this expected type containing the expected ship *e*. 4- Send a transaction to the retrieved entry point of the Squadron contract. The transaction must point to the _moduleResponse_ entrypoint of squadron contract and passing the right argument prepared in step 3. This transaction sends no money. The transaction is an _operation_ type that you can store in a variable *sendbackOperation*. diff --git a/src/frontend/src/pages/Chapters/Reason/ChapterPolymorphism/course.md b/src/frontend/src/pages/Chapters/Reason/ChapterPolymorphism/course.md index 80c5c52..4fb792b 100644 --- a/src/frontend/src/pages/Chapters/Reason/ChapterPolymorphism/course.md +++ b/src/frontend/src/pages/Chapters/Reason/ChapterPolymorphism/course.md @@ -55,8 +55,8 @@ As you can see, the entry point _RetrieveShip_ calls the function _sendTx_ which 1- Try to retrieve the entry point %moduleResponse of the given *callbackAddress* and store the result in a variable called *contractInterfaceOpt* of type _option(contract(actionSquadron))_ -2- Use a _switch_ operator to extract the entry point if it exists (use temporary variable name *ci* in the switch). Otherwise throw an exception with error message "Entrypoint not found in contract Squadron". The extracted entry point must be stored in a variable called *contractInterface*. +2- Use a _switch_ operator to extract the entry point if it exists (use temporary variable name *ci* in the switch). Otherwise throw an exception with error message "Entrypoint not found in contract Squadron" (and don't forget to cast the exception in the right type). The extracted entry point must be stored in a variable called *contractInterface*. -3- In order to prepare the ship information that need to be sent back to the Squadron contract. Check the expected type of entry point _moduleResponse_ and prepare a variable *ee* containing the expected ship *e*. +3- In order to prepare the ship information that need to be sent back to the Squadron contract. Check the expected type of entry point _ModuleResponse_ and prepare a variable *ee* of this expected type containing the expected ship *e*. 4- Send a transaction to the retrieved entry point of the Squadron contract. The transaction must point to the _moduleResponse_ entrypoint of squadron contract and passing the right argument prepared in step 3. This transaction sends no money. The transaction is an _operation_ type that you can store in a variable *sendbackOperation*.