include the receiver side in validation section
This commit is contained in:
parent
9a596c6b0f
commit
f22f9c1c91
|
@ -136,7 +136,7 @@ FROST inherit types from `jubjub` such as `Scalar`, `ExtendedPoint`, `AffinePoin
|
|||
|
||||
## Validation
|
||||
|
||||
Validation is implemented to each new data type as needed. This will ensure the creation of valid messages before they are sent. We create a trait for this as follows:
|
||||
Validation is implemented to each new data type as needed. This will ensure the creation of valid messages before they are sent and right after they are received. We create a trait for this as follows:
|
||||
|
||||
```rust
|
||||
pub trait Validate {
|
||||
|
@ -165,6 +165,12 @@ let header = Validate::validate(&Header {
|
|||
}).clone();
|
||||
```
|
||||
|
||||
The receiver side will validate the header as:
|
||||
|
||||
```rust
|
||||
msg.header.validate();
|
||||
```
|
||||
|
||||
## Testing plan
|
||||
|
||||
- Create a happy path unit test similar to https://github.com/ZcashFoundation/redjubjub/blob/frost-messages/tests/frost.rs#L7 and:
|
||||
|
|
Loading…
Reference in New Issue