mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Allow HTTP API to return SSZ blocks (#2209)
## Issue Addressed Implements https://github.com/ethereum/eth2.0-APIs/pull/125 ## Proposed Changes Optionally return SSZ bytes from the `beacon/blocks` endpoint.
This commit is contained in:
@@ -955,16 +955,18 @@ impl ApiTester {
|
||||
|
||||
pub async fn test_beacon_blocks(self) -> Self {
|
||||
for block_id in self.interesting_block_ids() {
|
||||
let result = self
|
||||
let expected = self.get_block(block_id);
|
||||
|
||||
let json_result = self
|
||||
.client
|
||||
.get_beacon_blocks(block_id)
|
||||
.await
|
||||
.unwrap()
|
||||
.map(|res| res.data);
|
||||
assert_eq!(json_result, expected, "{:?}", block_id);
|
||||
|
||||
let expected = self.get_block(block_id);
|
||||
|
||||
assert_eq!(result, expected, "{:?}", block_id);
|
||||
let ssz_result = self.client.get_beacon_blocks_ssz(block_id).await.unwrap();
|
||||
assert_eq!(ssz_result, expected, "{:?}", block_id);
|
||||
}
|
||||
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user