-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ✨ New Staking Contract * ✅ Fix consensus it test * typo * ✅ Fix genesis test * ✅ Fix amm e2e test * ✅ Fix some e2e * ✅ rejoin flow (very flakky) * 🚧 * ✅ Fix rejoin * clean & rebuild contract * clean * ignore flakky test
- Loading branch information
Showing
43 changed files
with
1,285 additions
and
457 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
use bincode::Decode; | ||
|
||
use crate::{Blob, BlobIndex, StructuredBlob}; | ||
|
||
pub fn parse_blob<Parameters>(blobs: &[Blob], index: &BlobIndex) -> Parameters | ||
where | ||
Parameters: Decode, | ||
{ | ||
let blob = match blobs.get(index.0) { | ||
Some(v) => v, | ||
None => { | ||
panic!("unable to find the payload"); | ||
} | ||
}; | ||
|
||
let (parameters, _) = | ||
bincode::decode_from_slice(blob.data.0.as_slice(), bincode::config::standard()) | ||
.expect("Failed to decode payload"); | ||
parameters | ||
} | ||
|
||
pub fn parse_structured_blob<Parameters>( | ||
blobs: &[Blob], | ||
index: &BlobIndex, | ||
) -> StructuredBlob<Parameters> | ||
where | ||
Parameters: Decode, | ||
{ | ||
let blob = match blobs.get(index.0) { | ||
Some(v) => v, | ||
None => { | ||
panic!("unable to find the payload"); | ||
} | ||
}; | ||
|
||
let parsed_blob: StructuredBlob<Parameters> = StructuredBlob::try_from(blob.clone()) | ||
.unwrap_or_else(|e| { | ||
panic!("Failed to decode blob: {:?}", e); | ||
}); | ||
parsed_blob | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
d10937cad6d5d0b18bd99a22f62c0f52fd591e4c18fd6ba7ba98a5e1088a219b | ||
5dcae35e603495a426fa821a0d15fe43268a99addead70b87057078c925578e7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
a97a8642215dafd0402deaa87de330cbeb603301e3b328a76a66526b83fc7ede | ||
8b71902dc20d7e2693645365169506e11cb4eab19e1f8bbbad262cbd60ecd22d |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
e085fa46f2e62d69897fc77f379c0ba1d252d7285f84dbcc017957567d1e812f | ||
9cdb9039b39c5799c41629d736d69062eea31d06586c64e097d69714a908575b |
Oops, something went wrong.