Skip to content

Commit 35a333b

Browse files
fix: replace deprecated evm::log with stylus_core::log
- Updated all 6 instances of evm::log to use log(vm, event) syntax - Removed unused evm import from stylus_sdk imports - All tests pass successfully (13 passed; 0 failed) - Eliminates deprecation warnings for logging functions Co-Authored-By: [email protected] <[email protected]>
1 parent 421b780 commit 35a333b

File tree

1 file changed

+6
-7
lines changed
  • target_chains/stylus/contracts/pyth-receiver/src

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ use stylus_sdk::{
2121
alloy_primitives::{Address, FixedBytes, I32, I64, U16, U256, U32, U64},
2222
alloy_sol_types::sol,
2323
call::Call,
24-
evm,
2524
prelude::*,
2625
storage::{
2726
StorageAddress, StorageBool, StorageFixedBytes, StorageMap, StorageU16, StorageU256,
@@ -610,15 +609,15 @@ impl PythReceiver {
610609

611610
self.single_update_fee_in_wei.set(new_fee);
612611

613-
evm::log(FeeSet { old_fee, new_fee });
612+
log(self.vm(), FeeSet { old_fee, new_fee });
614613
}
615614

616615
fn set_valid_period(&mut self, valid_time_period_seconds: u64) {
617616
let old_valid_period = self.valid_time_period_seconds.get();
618617
let new_valid_period = U256::from(valid_time_period_seconds);
619618
self.valid_time_period_seconds.set(new_valid_period);
620619

621-
evm::log(ValidPeriodSet {
620+
log(self.vm(), ValidPeriodSet {
622621
old_valid_period,
623622
new_valid_period,
624623
});
@@ -724,7 +723,7 @@ impl PythReceiver {
724723
self.last_executed_governance_sequence
725724
.set(U64::from(last_executed_governance_sequence));
726725

727-
evm::log(GovernanceDataSourceSet {
726+
log(self.vm(), GovernanceDataSourceSet {
728727
old_chain_id: current_index as u16,
729728
old_emitter_address: self.governance_data_source_emitter_address.get(),
730729
new_chain_id: claim_vm.body.emitter_chain,
@@ -741,7 +740,7 @@ impl PythReceiver {
741740

742741
self.transaction_fee_in_wei.set(new_fee);
743742

744-
evm::log(TransactionFeeSet { old_fee, new_fee });
743+
log(self.vm(), TransactionFeeSet { old_fee, new_fee });
745744
}
746745

747746
fn withdraw_fee(
@@ -761,7 +760,7 @@ impl PythReceiver {
761760
.transfer_eth(target_address, fee_to_withdraw)
762761
.map_err(|_| PythReceiverError::InsufficientFee)?;
763762

764-
evm::log(FeeWithdrawn {
763+
log(self.vm(), FeeWithdrawn {
765764
target_address,
766765
fee_amount: fee_to_withdraw,
767766
});
@@ -834,7 +833,7 @@ fn set_data_sources(receiver: &mut PythReceiver, data_sources: Vec<DataSource>)
834833
receiver.is_valid_data_source.setter(data_source).set(true);
835834
}
836835

837-
evm::log(DataSourcesSet {
836+
log(receiver.vm(), DataSourcesSet {
838837
old_data_sources,
839838
new_data_sources,
840839
});

0 commit comments

Comments
 (0)