From 3ba90474375197281f58c06196fb9c45af02c320 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 8 Aug 2023 17:33:25 +1000 Subject: [PATCH] Fix release tests --- beacon_node/http_api/tests/broadcast_validation_tests.rs | 5 +++-- beacon_node/http_api/tests/tests.rs | 6 +++++- beacon_node/network/src/network_beacon_processor/tests.rs | 2 +- common/eth2/src/lib.rs | 2 +- common/eth2/src/types.rs | 3 ++- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/beacon_node/http_api/tests/broadcast_validation_tests.rs b/beacon_node/http_api/tests/broadcast_validation_tests.rs index 8609938e3..d6287038e 100644 --- a/beacon_node/http_api/tests/broadcast_validation_tests.rs +++ b/beacon_node/http_api/tests/broadcast_validation_tests.rs @@ -210,7 +210,8 @@ pub async fn gossip_full_pass_ssz() { let slot_b = slot_a + 1; let state_a = tester.harness.get_current_state(); - let (block, _): (SignedBeaconBlock, _) = tester.harness.make_block(state_a, slot_b).await; + let ((block, _), _): ((SignedBeaconBlock, _), _) = + tester.harness.make_block(state_a, slot_b).await; let response: Result<(), eth2::Error> = tester .client @@ -906,7 +907,7 @@ pub async fn blinded_gossip_full_pass_ssz() { let slot_b = slot_a + 1; let state_a = tester.harness.get_current_state(); - let (block, _): (SignedBlindedBeaconBlock, _) = + let ((block, _), _): ((SignedBlindedBeaconBlock, _), _) = tester.harness.make_blinded_block(state_a, slot_b).await; let response: Result<(), eth2::Error> = tester diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index 89c76beaa..992eb92b1 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -1307,7 +1307,11 @@ impl ApiTester { .await .0; - assert!(self.client.post_beacon_blocks_ssz(&block).await.is_err()); + assert!(self + .client + .post_beacon_blocks_ssz(&SignedBlockContents::from(block)) + .await + .is_err()); assert!( self.network_rx.network_recv.recv().await.is_some(), diff --git a/beacon_node/network/src/network_beacon_processor/tests.rs b/beacon_node/network/src/network_beacon_processor/tests.rs index 1f8ff0106..ebe5bd123 100644 --- a/beacon_node/network/src/network_beacon_processor/tests.rs +++ b/beacon_node/network/src/network_beacon_processor/tests.rs @@ -343,7 +343,7 @@ impl TestRig { self.network_beacon_processor .send_blobs_by_range_request( PeerId::random(), - (ConnectionId::new(42), SubstreamId::new(24)), + (ConnectionId::new_unchecked(42), SubstreamId::new(24)), BlobsByRangeRequest { start_slot: 0, count, diff --git a/common/eth2/src/lib.rs b/common/eth2/src/lib.rs index ec4c7d63f..820ca23bd 100644 --- a/common/eth2/src/lib.rs +++ b/common/eth2/src/lib.rs @@ -707,7 +707,7 @@ impl BeaconNodeHttpClient { /// Returns `Ok(None)` on a 404 error. pub async fn post_beacon_blocks_ssz>( &self, - block: &SignedBeaconBlock, + block: &SignedBlockContents, ) -> Result<(), Error> { let mut path = self.eth_path(V1)?; diff --git a/common/eth2/src/types.rs b/common/eth2/src/types.rs index 7851b590d..60ee30410 100644 --- a/common/eth2/src/types.rs +++ b/common/eth2/src/types.rs @@ -1424,9 +1424,10 @@ pub type BlockContentsTuple = ( ); /// A wrapper over a [`SignedBeaconBlock`] or a [`SignedBeaconBlockAndBlobSidecars`]. -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Encode, Serialize, Deserialize)] #[serde(untagged)] #[serde(bound = "T: EthSpec")] +#[ssz(enum_behaviour = "transparent")] pub enum SignedBlockContents = FullPayload> { BlockAndBlobSidecars(SignedBeaconBlockAndBlobSidecars), Block(SignedBeaconBlock),