Skip to content

Commit 6410327

Browse files
committed
Make external pages better, include common patterns, wiwik
1 parent 1f4c41d commit 6410327

8 files changed

Lines changed: 829 additions & 25 deletions

File tree

src/pages/user-manual/language_tour/_meta.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@
99
"loop_statements": "Loop Statements",
1010
"functions": "Functions",
1111
"builtins": "Builtins",
12-
"stdlib": "Standard Library"
12+
"stdlib": {
13+
"title": "Standard Library",
14+
"type": "page",
15+
"href": "https://opshin.opshin.dev/opshin/std/index.html",
16+
"newWindow": true
17+
}
1318
}

src/pages/user-manual/language_tour/stdlib.mdx

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/pages/user-manual/smart_contract_tour/_meta.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,19 @@
44
"the_scriptcontext": "The ScriptContext",
55
"handling_time": "Handling Time",
66
"migration_v3": "Migrating to PlutusV3",
7+
"common_design_patterns": "Common Design Patterns",
78
"advanced": "Advanced Topics",
8-
"ledger_def": "Ledger Definitions",
9-
"examples": "Examples"
9+
"what_i_wish_i_knew": "What I Wish I Knew",
10+
"ledger_def": {
11+
"title": "Ledger Definitions",
12+
"type": "page",
13+
"href": "https://opshin.opshin.dev/opshin/ledger/index.html",
14+
"newWindow": true
15+
},
16+
"examples": {
17+
"title": "Examples",
18+
"type": "page",
19+
"href": "https://github.com/OpShin/awesome-opshin/#examples",
20+
"newWindow": true
21+
}
1022
}

src/pages/user-manual/smart_contract_tour/advanced.mdx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,19 @@ This contract will fail if anything but a PlutusData object with constructor id
105105
and two fields, first integer and second bytes, is passed as a datum into the contract.
106106

107107
> Note: Yes, this implies that without the explicit check the contract may pass with whatever
108-
> type d is, since its field or constructor id are never explicitly accessed.
108+
> type datum _actually_ is, since its fields or constructor id are never explicitly accessed.
109109
110110
```python
111111
from opshin.prelude import *
112112
from opshin.std.integrity import check_integrity
113113

114114
@dataclass
115-
class A(PlutusData)
115+
class SomeDatum(PlutusData)
116116
CONSTR_ID = 2
117117
a: int
118118
b: bytes
119119

120-
def validator(d: A, r: int, c: ScriptContext):
121-
check_integrity(d)
120+
def validator(context: ScriptContext):
121+
datum: SomeDatum = own_datum_unsafe(context)
122+
check_integrity(datum)
122123
```

0 commit comments

Comments
 (0)