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 d6c748e
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions soroban-env-host/tests/fees.rs
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down

0 comments on commit d6c748e

Please sign in to comment.