Skip to content

Commit

Permalink
docs: minor docs update (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcGuiselin authored Jan 2, 2025
1 parent eda96c0 commit 7cd002b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
6 changes: 2 additions & 4 deletions docs/src/components/contracts.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,8 @@ language for writing contracts.

#### The `ContractInterface` Trait

Rust contracts implement the `ContractInterface` trait, which defines the
functions that the core calls to interact with the contract. This trait is
defined in the
[freenet-stdlib](https://github.com/freenet/freenet-stdlib/blob/f28e6716364b4e1c9ae8837344286393a2da4c82/rust/src/contract_interface.rs#L446).
Rust contracts implement the [`ContractInterface`](https://docs.rs/freenet-stdlib/latest/freenet_stdlib/prelude/trait.ContractInterface.html) trait, which defines the
functions that the core calls to interact with the contract.

```rust,no_run,noplayground
{{#include ../../../stdlib/rust/src/contract_interface.rs:contractifce}}
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/delegates.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ User Interfaces, and other Delegates. They can also communicate directly with
the user, such as to request user permissions or notify the user of events.

Implemented in WebAssembly and adhering to the
[DelegateInterface](https://github.com/freenet/freenet-core/blob/b1e59528eaeba31c7f09881594d19347de60e8cd/crates/freenet-stdlib/src/delegate_interface.rs#L121)
[DelegateInterface](https://docs.rs/freenet-stdlib/latest/freenet_stdlib/prelude/trait.DelegateInterface.html)
trait, Delegates seamlessly integrate within the Freenet network, operating
securely on your devices.

Expand Down
7 changes: 5 additions & 2 deletions docs/src/contract-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@

## Interface

Freenet contracts must implement the contract interface from [stdlib/rust/src/contract_interface.rs](https://github.com/freenet/freenet-stdlib/blob/main/rust/src/contract_interface.rs#L446-L483):
Freenet contracts must implement the [`ContractInterface`](https://docs.rs/freenet-stdlib/latest/freenet_stdlib/prelude/trait.ContractInterface.html) trait:

```rust,no_run,noplayground
{{#include ../../stdlib/rust/src/contract_interface.rs:contractifce}}
```

`Parameters`, `State`, and `StateDelta` are all wrappers around simple `[u8]` byte arrays for maximum efficiency and flexibility.
[`Parameters`](https://docs.rs/freenet-stdlib/latest/freenet_stdlib/prelude/struct.Parameters.html),
[`State`](https://docs.rs/freenet-stdlib/latest/freenet_stdlib/prelude/struct.State.html),
and [`StateDelta`](https://docs.rs/freenet-stdlib/latest/freenet_stdlib/prelude/struct.StateDelta.html)
are all wrappers around simple `[u8]` byte arrays for maximum efficiency and flexibility.

## Contract Interaction

Expand Down
3 changes: 2 additions & 1 deletion modules/antiflood-tokens/interfaces/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,8 @@ pub struct TokenAssignment {
pub tier: Tier,
pub time_slot: DateTime<Utc>,
/// The public key of the generator of this token, and by extension, the one who created the signature.
/// This field can be used tipically to verify, that the token has been indeed generated by this generator.
///
/// This field can be used to verify that the token has been indeed generated by this generator.
pub generator: Assignee,
#[serde(with = "token_sig_ser")]
/// `(tier, issue_time, assignee)` must be signed by `generator_public_key`
Expand Down

0 comments on commit 7cd002b

Please sign in to comment.