diff --git a/soroban-env-host/tests/fees.rs b/soroban-env-host/tests/fees.rs index 9bef7d335..ff7211eef 100644 --- a/soroban-env-host/tests/fees.rs +++ b/soroban-env-host/tests/fees.rs @@ -1,8 +1,20 @@ -use soroban_env_host::fees::{ - compute_rent_fee, compute_transaction_resource_fee, compute_write_fee_per_1kb, - FeeConfiguration, LedgerEntryRentChange, RentFeeConfiguration, TransactionResources, - WriteFeeConfiguration, -}; +use soroban_env_common::xdr::{Hash, LedgerEntry, LedgerEntryData, LedgerEntryExt, WriteXdr}; +use soroban_env_host::fees::{compute_rent_fee, compute_transaction_resource_fee, compute_write_fee_per_1kb, EXPIRATION_ENTRY_SIZE, FeeConfiguration, LedgerEntryRentChange, RentFeeConfiguration, TransactionResources, WriteFeeConfiguration}; +use soroban_env_host::xdr::ExpirationEntry; + +#[test] +fn expiration_entry_size() { + let expiration_entry = LedgerEntry{ + last_modified_ledger_seq: 0, + data: LedgerEntryData::Expiration(ExpirationEntry{ + key_hash: Hash([0; 32]), + expiration_ledger_seq: 0, + }), + ext: LedgerEntryExt::V0, + }; + assert_eq!(EXPIRATION_ENTRY_SIZE, expiration_entry.to_xdr().unwrap().len() as u32) + +} #[test] fn resource_fee_computation() {