include the receiver side in validation section

This commit is contained in:
Alfredo Garcia 2021-05-04 14:52:39 -03:00 committed by Deirdre Connolly
parent 9a596c6b0f
commit f22f9c1c91
1 changed files with 7 additions and 1 deletions

View File

@ -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: