From ed2a6f19c659ed1505edc97b206aee082f48e97f Mon Sep 17 00:00:00 2001 From: Guillermo Bescos Date: Wed, 24 Jan 2024 21:59:29 +0000 Subject: [PATCH] More green --- .../near/receiver/tests/workspaces.rs | 65 +------------------ 1 file changed, 1 insertion(+), 64 deletions(-) diff --git a/target_chains/near/receiver/tests/workspaces.rs b/target_chains/near/receiver/tests/workspaces.rs index cb28cf4010..3a56d21e47 100644 --- a/target_chains/near/receiver/tests/workspaces.rs +++ b/target_chains/near/receiver/tests/workspaces.rs @@ -983,69 +983,6 @@ async fn test_accumulator_updates() { Message::PriceFeedMessage(msg) } - // fn create_accumulator_message_from_updates( - // price_updates: Vec, - // tree: MerkleTree, - // emitter_address: [u8; 32], - // emitter_chain: u16, - // ) -> Vec { - // let mut root_hash = [0u8; 20]; - // root_hash.copy_from_slice(&to_vec::<_, BigEndian>(&tree.root).unwrap()[..20]); - // let wormhole_message = WormholeMessage::new(WormholePayload::Merkle(WormholeMerkleRoot { - // slot: 0, - // ring_size: 0, - // root: root_hash, - // })); - - // let vaa = wormhole_sdk::Vaa { - // emitter_chain: emitter_chain.into(), - // emitter_address: wormhole_sdk::Address(emitter_address), - // sequence: 2, - // payload: (), - // ..Default::default() - // }; - - // let vaa = { - // let mut cur = Cursor::new(Vec::new()); - // serde_wormhole::to_writer(&mut cur, &vaa).expect("Failed to serialize VAA"); - // cur.write_all(&to_vec::<_, BigEndian>(&wormhole_message).unwrap()) - // .expect("Failed to write Payload"); - // cur.into_inner() - // }; - - // let accumulator_update_data = AccumulatorUpdateData::new(Proof::WormholeMerkle { - // vaa: PrefixedVec::from(vaa), - // updates: price_updates, - // }); - - // to_vec::<_, BigEndian>(&accumulator_update_data).unwrap() - // } - - // fn create_accumulator_message(all_feeds: &[Message], updates: &[Message]) -> Vec { - // let all_feeds_bytes: Vec<_> = all_feeds - // .iter() - // .map(|f| to_vec::<_, BigEndian>(f).unwrap()) - // .collect(); - // let all_feeds_bytes_refs: Vec<_> = all_feeds_bytes.iter().map(|f| f.as_ref()).collect(); - // let tree = MerkleTree::::new(all_feeds_bytes_refs.as_slice()).unwrap(); - // let mut price_updates: Vec = vec![]; - // for update in updates { - // let proof = tree - // .prove(&to_vec::<_, BigEndian>(update).unwrap()) - // .unwrap(); - // price_updates.push(MerklePriceUpdate { - // message: PrefixedVec::from(to_vec::<_, BigEndian>(update).unwrap()), - // proof, - // }); - // } - // create_accumulator_message_from_updates( - // price_updates, - // tree, - // [1; 32], - // wormhole_sdk::Chain::Any.into(), - // ) - // } - let (_, contract, _) = initialize_chain().await; // Submit a new Source to the contract, this will trigger a cross-contract call to wormhole @@ -1099,7 +1036,7 @@ async fn test_accumulator_updates() { // Create a couple of test feeds. let feed_1 = create_dummy_price_feed_message(100); let feed_2 = create_dummy_price_feed_message(200); - let message = create_accumulator_message(&[feed_1, feed_2], &[feed_1]); + let message = create_accumulator_message(&[feed_1, feed_2], &[feed_1], false); let message = hex::encode(message); // Call the usual UpdatePriceFeed function.