Skip to content

Commit c9758cc

Browse files
committed
got rid of unused imports and calls
1 parent 629f40e commit c9758cc

File tree

3 files changed

+1
-80
lines changed

3 files changed

+1
-80
lines changed

target_chains/stylus/contracts/pyth-receiver/src/integration_tests.rs

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ mod test {
44
use crate::test_data;
55
use crate::error::PythReceiverError;
66
use alloy_primitives::{address, U256, Address, U64, I64, I32};
7-
use stylus_sdk::testing::TestVM;
87
use motsu::prelude::*;
98
use wormhole_contract::WormholeContract;
109
const TEST_PRICE_ID: [u8; 32] = [
@@ -28,34 +27,6 @@ mod test {
2827
const GOVERNANCE_CHAIN_ID: u16 = 1;
2928
const GOVERNANCE_CONTRACT: U256 = U256::from_limbs([4, 0, 0, 0]);
3029

31-
fn initialize_test_contract(vm: &TestVM) -> PythReceiver {
32-
let mut contract = PythReceiver::from(vm);
33-
let wormhole_address = address!("0x395921b642ba511d421ae834fef56ac886735ca2");
34-
let single_update_fee = U256::from(100u64);
35-
let valid_time_period = U256::from(3600u64);
36-
37-
let data_source_chain_ids = vec![PYTHNET_CHAIN_ID];
38-
let data_source_emitter_addresses = vec![PYTHNET_EMITTER_ADDRESS];
39-
40-
let governance_chain_id = 1u16;
41-
let governance_emitter_address = [3u8; 32];
42-
let governance_initial_sequence = 0u64;
43-
let data = vec![];
44-
45-
contract.initialize(
46-
wormhole_address,
47-
single_update_fee,
48-
valid_time_period,
49-
data_source_chain_ids,
50-
data_source_emitter_addresses,
51-
governance_chain_id,
52-
governance_emitter_address,
53-
governance_initial_sequence,
54-
data,
55-
);
56-
contract
57-
}
58-
5930
#[cfg(test)]
6031
fn current_guardians() -> Vec<Address> {
6132
vec![
@@ -410,7 +381,7 @@ mod test {
410381
governance_initial_sequence,
411382
data,
412383
);
413-
384+
414385
alice.fund(U256::from(200));
415386

416387
let update_data = test_data::multiple_updates();

target_chains/stylus/contracts/pyth-receiver/src/structs.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use stylus_sdk::{
88
},
99
};
1010
use stylus_sdk::alloy_primitives::{U16, FixedBytes,U64, I32, I64, B256, U256, keccak256};
11-
use pythnet_sdk::messages::PriceFeedMessage;
1211

1312
#[derive(Serialize)]
1413
struct SerializableDataSource {

target_chains/stylus/contracts/pyth-receiver/src/test_data.rs

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -100,55 +100,6 @@ pub fn test_price_update1() -> Vec<u8> {
100100
from_cairo_byte_array_data(&bytes, 25)
101101
}
102102

103-
pub fn test_price_update2() -> Vec<u8> {
104-
let bytes = [
105-
U256::from_str_radix("141887862745809943100421399774809552050874823427618844548942380383465221086", 10).unwrap(),
106-
U256::from_str_radix("106893583704677921907497845070624642590618427233243792006390965895909696183", 10).unwrap(),
107-
U256::from_str_radix("126617671723931969110123875642449115250793288301361049879364132884271078113", 10).unwrap(),
108-
U256::from_str_radix("3498691308882995183871222184377409432186747119716981166996399082193594993", 10).unwrap(),
109-
U256::from_str_radix("1390200461185063661704370212555794334034815850290352693418762308", 10).unwrap(),
110-
U256::from_str_radix("419598057710749587537080281518289024699150505326900462079484531390510117965", 10).unwrap(),
111-
U256::from_str_radix("341318259000017461738706238280879290398059773267212529438780607147892801536", 10).unwrap(),
112-
U256::from_str_radix("1437437604754599821041091415535991441313586347841485651963630208563420739", 10).unwrap(),
113-
U256::from_str_radix("305222830440467078008666830004555943609735125691441831219591213494068931362", 10).unwrap(),
114-
U256::from_str_radix("358396406696718360717615797531477055540194104082154743994717297650279402646", 10).unwrap(),
115-
U256::from_str_radix("429270385827211102844129651648706540139690432947840438198166022904666187018", 10).unwrap(),
116-
U256::from_str_radix("343946166212648899477337159288779715507980257611242783073384876024451565860", 10).unwrap(),
117-
U256::from_str_radix("67853010773876862913176476530730880916439012004585961528150130218675908823", 10).unwrap(),
118-
U256::from_str_radix("370855179649505412564259994413632062925303311800103998016489412083011059699", 10).unwrap(),
119-
U256::from_str_radix("1182295126766215829784496273374889928477877265080355104888778", 10).unwrap(),
120-
];
121-
from_cairo_byte_array_data(&bytes, 25)
122-
}
123-
124-
pub fn pyth_set_fee() -> Vec<u8> {
125-
let bytes = [
126-
U256::from_str_radix("1766847064779993955862540543984267022910717161432209540262366788014689913", 10).unwrap(),
127-
U256::from_str_radix("322968519187498395396360816568387642032723484530650782503164941848016432477", 10).unwrap(),
128-
U256::from_str_radix("49565958604199796163020368", 10).unwrap(),
129-
U256::from_str_radix("8072278384728444780182694421117884443886221966887092226", 10).unwrap(),
130-
];
131-
from_cairo_byte_array_data(&bytes, 23)
132-
}
133-
134-
pub fn pyth_set_data_sources() -> Vec<u8> {
135-
let bytes = [
136-
U256::from_str_radix("1766847064779993795984967344618836356750759980724568847727566676204733945", 10).unwrap(),
137-
U256::from_str_radix("319252252405206634291073190903653114488682078063415369176250618646860635118", 10).unwrap(),
138-
U256::from_str_radix("223938022913800988696085410923418445187967252047785407181969631814277398528", 10).unwrap(),
139-
U256::from_str_radix("301", 10).unwrap(),
140-
];
141-
from_cairo_byte_array_data(&bytes, 14)
142-
}
143-
144-
pub fn create_realistic_price_update_test() -> Vec<u8> {
145-
test_price_update1()
146-
}
147-
148-
pub fn create_realistic_vaa_test() -> Vec<u8> {
149-
good_vm1()
150-
}
151-
152103
#[cfg(test)]
153104
mod tests {
154105
use super::*;

0 commit comments

Comments
 (0)