Skip to content

Commit

Permalink
Add test to check EXPIRATION_ENTRY_SIZE
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Sep 5, 2023
1 parent 42138d4 commit 3eb3c31
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion soroban-env-host/tests/fees.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,26 @@
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,
FeeConfiguration, LedgerEntryRentChange, RentFeeConfiguration, TransactionResources,
WriteFeeConfiguration,
WriteFeeConfiguration, EXPIRATION_ENTRY_SIZE,
};
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() {
Expand Down

0 comments on commit 3eb3c31

Please sign in to comment.