Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
2opremio committed Sep 4, 2023
1 parent 69037db commit 42138d4
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions soroban-env-host/tests/fees.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,9 @@ fn test_rent_bump_fees_with_only_bump() {
50_000,
),
// Rent: ceil(1 * 1000 * 200_000 / (10_000 * 1024)) (=20) +
// Expiration entry write bytes: ceil(1000 * 36 / 1024) (=36) +
// Expiration entry write bytes: ceil(1000 * 48 / 1024) (=47) +
// Expiration entry write: 10
20 + 36 + 10
20 + 47 + 10
);

// Minimal ledgers
Expand All @@ -160,8 +160,8 @@ fn test_rent_bump_fees_with_only_bump() {
50_000,
),
// Rent: ceil(10 * 1024 * 1000 * 1 / (10_000 * 1024)) (=1) +
// Expiration entry write entry/bytes: 46
1 + 46
// Expiration entry write entry/bytes: 57
1 + 57
);

// Minimal ledgers & size
Expand All @@ -178,8 +178,8 @@ fn test_rent_bump_fees_with_only_bump() {
50_000,
),
// Rent: ceil(1 * 1000 * 1 / (10_000 * 1024))
// Expiration entry write entry/bytes: 46
1 + 46
// Expiration entry write entry/bytes: 57
1 + 57
);

// No size change
Expand All @@ -196,8 +196,8 @@ fn test_rent_bump_fees_with_only_bump() {
50_000,
),
// Rent: ceil(10 * 1024 * 1000 * 200_000 / (10_000 * 1024)) (=200_000)
// Expiration entry write entry/bytes: 46
200_000 + 46
// Expiration entry write entry/bytes: 57
200_000 + 57
);

// Size decrease
Expand All @@ -214,8 +214,8 @@ fn test_rent_bump_fees_with_only_bump() {
50_000,
),
// Rent: ceil(5 * 1024 * 1000 * 200_000 / (10_000 * 1024)) (=100_000) +
// Expiration entry write entry/bytes: 46
100_000 + 46
// Expiration entry write entry/bytes: 57
100_000 + 57
);

// Temp storage rate
Expand All @@ -232,8 +232,8 @@ fn test_rent_bump_fees_with_only_bump() {
50_000,
),
// Rent: ceil(10 * 1024 * 1000 * 200_000 / (100_000 * 1024)) (=20_000) +
// Expiration entry write entry/bytes: 46
20_000 + 46
// Expiration entry write entry/bytes: 57
20_000 + 57
);

// Multiple entries
Expand Down Expand Up @@ -287,9 +287,9 @@ fn test_rent_bump_fees_with_only_bump() {
50_000,
),
// Rent: 20_000 + 200_000 + 1 + 20 + 200_000 + 20_000 (=440_021) +
// Expiration entry write bytes: ceil(6 * 1000 * 36 / 1024) (=211) +
// Expiration entry write bytes: ceil(6 * 1000 * 48 / 1024) (=282) +
// Expiration entry write: 10 * 6
440_021 + 211 + 60
440_021 + 282 + 60
);
}

Expand Down Expand Up @@ -421,8 +421,8 @@ fn test_rent_bump_with_size_change_and_bump() {
),
// Rent: 100_000 * 1000 * 200_000 / (10_000 * 1024) +
// 99_999 * 1000 * (100_000 - 25_000 + 1) / (10_000 * 1024)
// Expiration entry write entry/bytes: 46
2_685_550 + 46
// Expiration entry write entry/bytes: 57
2_685_550 + 57
);

// Temp entry
Expand All @@ -440,8 +440,8 @@ fn test_rent_bump_with_size_change_and_bump() {
),
// Rent: 100_000 * 1000 * 200_000 / (10_000 * 1024) +
// 99_999 * 1000 * (100_000 - 25_000 + 1) / (10_000 * 1024)
// Expiration entry write entry/bytes: 46
268_556 + 46
// Expiration entry write entry/bytes: 57
268_556 + 57
);

// Multiple entries
Expand All @@ -467,9 +467,9 @@ fn test_rent_bump_with_size_change_and_bump() {
25_000,
),
// Rent: 2_685_550 + 268_556
// Expiration entry write bytes: ceil(2 * 1000 * 36 / 1024) (=71) +
// Expiration entry write bytes: ceil(2 * 1000 * 48 / 1024) (=94) +
// Expiration entry write: 10 * 2
2_954_106 + 71 + 20
2_954_106 + 94 + 20
);

// Small increments
Expand All @@ -487,8 +487,8 @@ fn test_rent_bump_with_size_change_and_bump() {
),
// Rent: ceil(2 * 1000 * 1 / (10_000 * 1024)) +
// ceil(1 * 1000 * (100_000 - 99_999 + 1) / (10_000 * 1024)) (=2)
// Expiration entry write entry/bytes: 46
2 + 46
// Expiration entry write entry/bytes: 57
2 + 57
);
}

Expand All @@ -515,8 +515,8 @@ fn test_rent_bump_without_old_entry() {
25_000,
),
// Rent: 100_000 * 1000 * (100_000 - 25_000) / (10_000 * 1024)
// Expiration entry write entry/bytes: 46
732_432 + 46
// Expiration entry write entry/bytes: 57
732_432 + 57
);

// Temp storage
Expand All @@ -533,8 +533,8 @@ fn test_rent_bump_without_old_entry() {
25_000,
),
// Rent: 100_000 * 1000 * (100_000 - 25_000) / (10_000 * 1024)
// Expiration entry write entry/bytes: 46
73_244 + 46
// Expiration entry write entry/bytes: 57
73_244 + 57
);
}

Expand Down

0 comments on commit 42138d4

Please sign in to comment.