Update docs
This commit is contained in:
@ -11,7 +11,7 @@ with by verifying each entry's hash can be generated from the hash in the previo
|
|||||||
extern crate solana;
|
extern crate solana;
|
||||||
|
|
||||||
use solana::historian::Historian;
|
use solana::historian::Historian;
|
||||||
use solana::ledger::{verify_slice, Entry, Hash};
|
use solana::ledger::{Block, Entry, Hash};
|
||||||
use solana::event::{generate_keypair, get_pubkey, sign_claim_data, Event};
|
use solana::event::{generate_keypair, get_pubkey, sign_claim_data, Event};
|
||||||
use std::thread::sleep;
|
use std::thread::sleep;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
@ -38,7 +38,7 @@ fn main() {
|
|||||||
}
|
}
|
||||||
// Proof-of-History: Verify the historian learned about the events
|
// Proof-of-History: Verify the historian learned about the events
|
||||||
// in the same order they appear in the vector.
|
// in the same order they appear in the vector.
|
||||||
assert!(verify_slice(&entries, &seed));
|
assert!(entries[..].verify(&seed));
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ Proof-of-History
|
|||||||
Take note of the last line:
|
Take note of the last line:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
assert!(verify_slice(&entries, &seed));
|
assert!(entries[..].verify(&seed));
|
||||||
```
|
```
|
||||||
|
|
||||||
[It's a proof!](https://en.wikipedia.org/wiki/Curry–Howard_correspondence) For each entry returned by the
|
[It's a proof!](https://en.wikipedia.org/wiki/Curry–Howard_correspondence) For each entry returned by the
|
||||||
|
@ -14,5 +14,5 @@ msc {
|
|||||||
recorder=>historian [ label = "e2 = Entry{id: h6, n: 3, event: Tick}" ] ;
|
recorder=>historian [ label = "e2 = Entry{id: h6, n: 3, event: Tick}" ] ;
|
||||||
client=>historian [ label = "collect()" ] ;
|
client=>historian [ label = "collect()" ] ;
|
||||||
historian=>client [ label = "entries = [e0, e1, e2]" ] ;
|
historian=>client [ label = "entries = [e0, e1, e2]" ] ;
|
||||||
client=>client [ label = "verify_slice(entries, h0)" ] ;
|
client=>client [ label = "entries.verify(h0)" ] ;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user