Skip to content
Permalink
Browse files

Merge pull request #908 from input-output-hk/documentation-improvements

Documentation improvements.
  • Loading branch information...
michaelpj committed Apr 14, 2019
2 parents 56a4d1c + ea1e2a9 commit f7420c343dde2f579e19ce8d1c29075f8f793d3e
@@ -44,7 +44,7 @@ For each of the three script types (data, validator, redeemer) there are two art
|**Provided by Producer**| Data script | *N/A\** |
|**Provided by Consumer**| Validator script | Redeemer script |

The validator script must be submitted as part of the consuming transaction's input, but its content is determined by the producing transaction. Both hash and content of the data script are provided by the producing transaction, and hash and content of the redeemer are provided by the consumer.
The validator script must be submitted as part of the consuming transaction's input, but its content is determined by the producing transaction. Both the hash and content of the data script are provided by the producing transaction, and the hash and content of the redeemer are provided by the consumer.

When a transaction is validated, the validator script receives data and redeemer scripts and either terminates successfully or in the Plutus `error` state. This means that the producing transaction effectively determines the type of the redeemer script, even though the script itself (ie. a value of that type) is not known at that time. (One has to be careful not to lock a transaction output permanently by specifying a type that has no values other than `error`)

@@ -563,7 +563,7 @@ mainHeader =
]
where
links = [ Tuple "Getting Started" "https://testnet.iohkdev.io/plutus/get-started/writing-contracts-in-plutus/"
, Tuple "Tutorial" ("https://github.com/input-output-hk/plutus/blob/" <> gitHead <> "/plutus-tutorial/tutorial/Tutorial")
, Tuple "Tutorial" ("https://github.com/input-output-hk/plutus/blob/" <> gitHead <> "/plutus-tutorial/tutorial/Intro.md")
, Tuple "API" "https://input-output-hk.github.io/plutus/"
, Tuple "Privacy" "https://static.iohk.io/docs/data-protection/iohk-data-protection-gdpr-policy.pdf"
]
@@ -5,7 +5,7 @@ embedded programs that can be used when generating transactions.

This is the first in a series of tutorials:

1. Plutus Tx (this one)
1. Plutus Tx (this tutorial)
2. [A guessing game](./02-validator-scripts.md)
3. [A crowdfunding campaign](./03-wallet-api.md)
4. [Working with the emulator](../../tutorial/Tutorial/Emulator.hs)
@@ -155,9 +155,13 @@ functions = $$(compile [||
let
plusOneLocal :: Int -> Int
plusOneLocal x = x `addInteger` 1
-- This won't work.
-- This won't work:
-- nonLocalDoesntWork = plusOne 1
-- This will work:
localWorks = plusOneLocal 1
-- You can of course bind this to a name, but for the purposes
-- of this tutorial we won't since TH requires it to be in
-- another module.
@@ -288,3 +292,5 @@ pastEndAt end current =
`applyCode`
unsafeLiftCode current
```

The [next part](./02-validator-scripts.md) of the tutorial explains how to get Plutus onto the blockchain, using a simple guessing game as an example.
@@ -12,9 +12,9 @@ You can run this code in the [Plutus Playground](https://prod.playground.plutus.

We assume the reader is familiar with the [UTxO model with scripts](../../../docs/extended-utxo/README.md) and the [PlutusTx tutorial](./01-plutus-tx.md).

**WARNING** The wallet API and by extension the wallet API tutorial is a work in progress and may be changed without much warning.
**WARNING:** The wallet API and by extension the wallet API tutorial is a work in progress and may be changed without notice.

The tutorial has three parts. In part 1 we write the contract, including all the data types we need, validator scripts, and contract endpoints that handle the interactions between wallet and blockchain. In part 2 we show how to test the contract. Part 3 contains a number of questions and exercises related to this contract.
This tutorial has three parts. In part 1 we write the contract, including all the data types we need, validator scripts, and contract endpoints that handle the interactions between wallet and blockchain. In part 2 we show how to test the contract. Part 3 contains a number of questions and exercises.

# 1. Contract Definition

@@ -483,7 +483,7 @@ warnEmptyTransaction value addr =
$ logMsg
$ Text.unwords [
"Attempting to collect transaction outputs from"
, "'" <> Text.pack (show addr) <> "'"
, ", but there are no known outputs at that address."
, "'" <> Text.pack (show addr) <> "'" <> ","
, "but there are no known outputs at that address."
, "An empty transaction will be submitted."
]

0 comments on commit f7420c3

Please sign in to comment.
You can’t perform that action at this time.