Skip to content

Commit

Permalink
Fix list item numbering in substreams page (#800)
Browse files Browse the repository at this point in the history
  • Loading branch information
benface authored Oct 22, 2024
1 parent 498eb24 commit 5650fa2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions website/pages/en/substreams.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ Substreams is a powerful blockchain indexing technology designed to enhance perf

1. **You write a Rust program, which defines the transformations that you want to apply to the blockchain data.** For example, the following Rust function extracts relevant information from an Ethereum block (number, hash, and parent hash).

```rust
fn get_my_block(blk: Block) -> Result<MyBlock, substreams::errors::Error> {
let header = blk.header.as_ref().unwrap();

Ok(MyBlock {
number: blk.number,
hash: Hex::encode(&blk.hash),
parent_hash: Hex::encode(&header.parent_hash),
})
}
```
```rust
fn get_my_block(blk: Block) -> Result<MyBlock, substreams::errors::Error> {
let header = blk.header.as_ref().unwrap();

Ok(MyBlock {
number: blk.number,
hash: Hex::encode(&blk.hash),
parent_hash: Hex::encode(&header.parent_hash),
})
}
```

2. **You wrap up your Rust program into a WASM module just by running a single CLI command.**

Expand Down

0 comments on commit 5650fa2

Please sign in to comment.