Skip to content

Commit

Permalink
deploy: 84b29e1
Browse files Browse the repository at this point in the history
  • Loading branch information
damirka committed Jun 24, 2024
1 parent 64b0b72 commit 6f523d1
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 18 deletions.
7 changes: 6 additions & 1 deletion move-basics/ownership-and-scope.html
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,15 @@ <h2 id="ownership"><a class="header" href="#ownership">Ownership</a></h2>
let a = 1; // a is owned by the `owner` function
} // a is dropped here

public fun other() {
let b = 2; // b is owned by the `other` function
} // b is dropped here

#[test]
fun test_owner() {
owner();
// a is not valid here
other();
// a &amp; b is not valid here
}
}
</code></pre>
Expand Down
15 changes: 10 additions & 5 deletions print.html
Original file line number Diff line number Diff line change
Expand Up @@ -3327,10 +3327,15 @@ <h2 id="ownership"><a class="header" href="#ownership">Ownership</a></h2>
let a = 1; // a is owned by the `owner` function
} // a is dropped here

public fun other() {
let b = 2; // b is owned by the `other` function
} // b is dropped here

#[test]
fun test_owner() {
owner();
// a is not valid here
other();
// a &amp; b is not valid here
}
}
</code></pre>
Expand Down Expand Up @@ -4818,7 +4823,7 @@ <h2 id="init-features"><a class="header" href="#init-features"><code>init</code>
<ul>
<li>The function has to be named <code>init</code>, be private and have no return values.</li>
<li>Takes one or two arguments: <a href="programmability/./one-time-witness.html">One Time Witness</a> (optional) and
<a href="programmability/./transaction-context.html">TxContext</a>. With `TxContext always being the last argument.</li>
<a href="programmability/./transaction-context.html">TxContext</a>. With <code>TxContext</code> always being the last argument.</li>
</ul>
<pre><code class="language-move">fun init(ctx: &amp;mut TxContext) { /* ... */}
fun init(otw: OTW, ctx: &amp;mut TxContext) { /* ... */ }
Expand Down Expand Up @@ -5711,7 +5716,7 @@ <h2 id="witness-in-move"><a class="header" href="#witness-in-move">Witness in Mo
}
}
</code></pre>
<p>The instance of the struct <code>W</code> is passed into the <code>new</code> function to create an <code>Instance&lt;W&gt;</code>, thereby
<p>The instance of the struct <code>W</code> is passed into the <code>new_instance</code> function to create an <code>Instance&lt;W&gt;</code>, thereby
proving that the module <code>book::witness_source</code> owns the type <code>W</code>.</p>
<h2 id="instantiating-a-generic-type"><a class="header" href="#instantiating-a-generic-type">Instantiating a Generic Type</a></h2>
<p>Witness allows generic types to be instantiated with a concrete type. This is useful for inheriting
Expand Down Expand Up @@ -5987,7 +5992,7 @@ <h2 id="publisher-as-admin-role"><a class="header" href="#publisher-as-admin-rol
}
</code></pre>
<p>However, Publisher misses some native properties of <a href="programmability/./capability.html">Capabilities</a>, such as type
safety and expressiveness. The signature for the <code>admin_function</code> is not very explicit, can be
safety and expressiveness. The signature for the <code>admin_action</code> is not very explicit, can be
called by anyone else. And due to <code>Publisher</code> object being standard, there now is a risk of
unauthorized access if the <code>from_module</code> check is not performed. So it's important to be cautious
when using the <code>Publisher</code> object as an admin role.</p>
Expand Down Expand Up @@ -6383,7 +6388,7 @@ <h2 id="encoding"><a class="header" href="#encoding">Encoding</a></h2>
let bool_bytes = bcs::to_bytes(&amp;true);
// 0x2a - just a single byte
let u8_bytes = bcs::to_bytes(&amp;42u8);
// 0x000000000000002a - 8 bytes
// 0x2a00000000000000 - 8 bytes
let u64_bytes = bcs::to_bytes(&amp;42u64);
// address is a fixed sequence of 32 bytes
// 0x0000000000000000000000000000000000000000000000000000000000000002
Expand Down
2 changes: 1 addition & 1 deletion programmability/bcs.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ <h2 id="encoding"><a class="header" href="#encoding">Encoding</a></h2>
let bool_bytes = bcs::to_bytes(&amp;true);
// 0x2a - just a single byte
let u8_bytes = bcs::to_bytes(&amp;42u8);
// 0x000000000000002a - 8 bytes
// 0x2a00000000000000 - 8 bytes
let u64_bytes = bcs::to_bytes(&amp;42u64);
// address is a fixed sequence of 32 bytes
// 0x0000000000000000000000000000000000000000000000000000000000000002
Expand Down
2 changes: 1 addition & 1 deletion programmability/module-initializer.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ <h2 id="init-features"><a class="header" href="#init-features"><code>init</code>
<ul>
<li>The function has to be named <code>init</code>, be private and have no return values.</li>
<li>Takes one or two arguments: <a href="./one-time-witness.html">One Time Witness</a> (optional) and
<a href="./transaction-context.html">TxContext</a>. With `TxContext always being the last argument.</li>
<a href="./transaction-context.html">TxContext</a>. With <code>TxContext</code> always being the last argument.</li>
</ul>
<pre><code class="language-move">fun init(ctx: &amp;mut TxContext) { /* ... */}
fun init(otw: OTW, ctx: &amp;mut TxContext) { /* ... */ }
Expand Down
2 changes: 1 addition & 1 deletion programmability/publisher.html
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ <h2 id="publisher-as-admin-role"><a class="header" href="#publisher-as-admin-rol
}
</code></pre>
<p>However, Publisher misses some native properties of <a href="./capability.html">Capabilities</a>, such as type
safety and expressiveness. The signature for the <code>admin_function</code> is not very explicit, can be
safety and expressiveness. The signature for the <code>admin_action</code> is not very explicit, can be
called by anyone else. And due to <code>Publisher</code> object being standard, there now is a risk of
unauthorized access if the <code>from_module</code> check is not performed. So it's important to be cautious
when using the <code>Publisher</code> object as an admin role.</p>
Expand Down
2 changes: 1 addition & 1 deletion programmability/witness-pattern.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ <h2 id="witness-in-move"><a class="header" href="#witness-in-move">Witness in Mo
}
}
</code></pre>
<p>The instance of the struct <code>W</code> is passed into the <code>new</code> function to create an <code>Instance&lt;W&gt;</code>, thereby
<p>The instance of the struct <code>W</code> is passed into the <code>new_instance</code> function to create an <code>Instance&lt;W&gt;</code>, thereby
proving that the module <code>book::witness_source</code> owns the type <code>W</code>.</p>
<h2 id="instantiating-a-generic-type"><a class="header" href="#instantiating-a-generic-type">Instantiating a Generic Type</a></h2>
<p>Witness allows generic types to be instantiated with a concrete type. This is useful for inheriting
Expand Down
4 changes: 2 additions & 2 deletions reference/print.html
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ <h3 id="multiple-declarations-with-tuples"><a class="header" href="#multiple-dec
x = 1;
</code></pre>
<h3 id="multiple-declarations-with-structs"><a class="header" href="#multiple-declarations-with-structs">Multiple declarations with structs</a></h3>
<p><code>let</code> can also introduce more than one local at a time when destructuring (or matching against) a
<p><code>let</code> can also introduce more than one local variables at a time when destructuring (or matching against) a
struct. In this form, the <code>let</code> creates a set of local variables that are initialized to the values
of the fields from a struct. The syntax looks like this:</p>
<pre><code class="language-move">public struct T { f1: u64, f2: u64 }
Expand All @@ -1107,7 +1107,7 @@ <h3 id="multiple-declarations-with-structs"><a class="header" href="#multiple-de
<pre><code class="language-move">public struct P(u64, u64)
</code></pre>
<p>and</p>
<pre><code class="language-move">let P(local1, local2) = T { f1: 1, f2: 2 };
<pre><code class="language-move">let P (local1, local2) = P ( 1, 2 );
// local1: u64
// local2: u64
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion reference/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion reference/searchindex.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions reference/variables.html
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ <h3 id="multiple-declarations-with-tuples"><a class="header" href="#multiple-dec
x = 1;
</code></pre>
<h3 id="multiple-declarations-with-structs"><a class="header" href="#multiple-declarations-with-structs">Multiple declarations with structs</a></h3>
<p><code>let</code> can also introduce more than one local at a time when destructuring (or matching against) a
<p><code>let</code> can also introduce more than one local variables at a time when destructuring (or matching against) a
struct. In this form, the <code>let</code> creates a set of local variables that are initialized to the values
of the fields from a struct. The syntax looks like this:</p>
<pre><code class="language-move">public struct T { f1: u64, f2: u64 }
Expand All @@ -338,7 +338,7 @@ <h3 id="multiple-declarations-with-structs"><a class="header" href="#multiple-de
<pre><code class="language-move">public struct P(u64, u64)
</code></pre>
<p>and</p>
<pre><code class="language-move">let P(local1, local2) = T { f1: 1, f2: 2 };
<pre><code class="language-move">let P (local1, local2) = P ( 1, 2 );
// local1: u64
// local2: u64
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion searchindex.json

Large diffs are not rendered by default.

0 comments on commit 6f523d1

Please sign in to comment.