Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions soroban/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion soroban/contracts/factory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ doctest = false
soroban-sdk = { workspace = true }

[dev-dependencies]
soroban-sdk = { workspace = true, features = ["testutils"] }
soroban-sdk = { workspace = true, features = ["testutils"] }
farming-pool = { path = "../farming-pool" }
5 changes: 5 additions & 0 deletions soroban/contracts/factory/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ impl Factory {
env.events().publish(
(symbol_short!("factory"), symbol_short!("pool_upg")),
(pool_id, record.address, new_wasm_hash),
);

Ok(())
}

/// Update the WASM hash used for future `create_pool` deployments. Admin-only.
///
/// Allows the admin to point future pool deployments at a corrected or upgraded
Expand Down
6 changes: 3 additions & 3 deletions soroban/contracts/factory/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,15 +518,15 @@ fn test_get_pools_by_asset_paginates_large_matching_registry() {
let env = Env::default();
env.mock_all_auths();
let admin = Address::generate(&env);
let wasm_hash = upload_mock_pool_wasm(&env);
let wasm_hash = upload_farming_pool_wasm(&env);
let factory_addr = env.register(Factory, ());
let client = FactoryClient::new(&env, &factory_addr);
client.initialize(&admin, &wasm_hash);

// Create 25 pools all sharing the same asset
let asset = Address::generate(&env);
for i in 0..25 {
client.create_pool(&asset, &(100 + i as u128), &(10 + i as u64));
client.create_pool(&asset, &((100 + i as u128) * 17_280), &2u32, &(10 + i as u64));
}

// First page should return 20 records
Expand Down Expand Up @@ -716,7 +716,7 @@ fn test_refresh_pool_ttls_restores_ttl_for_unqueried_pool() {
let t = setup();
let id = t
.client
.create_pool(&Address::generate(&t.env), &250u128, &50u64);
.create_pool(&Address::generate(&t.env), &(250u128 * 17_280), &2u32, &50u64);

// Initial TTL after creation
assert_eq!(pool_record_ttl(&t.env, &t.factory_addr, id), TTL_EXTEND_TO);
Expand Down
Loading