fix: resolve settlement crate compile errors and align V2 per-token t…#601
Open
GreatShinro wants to merge 1 commit into
Open
fix: resolve settlement crate compile errors and align V2 per-token t…#601GreatShinro wants to merge 1 commit into
GreatShinro wants to merge 1 commit into
Conversation
…ypes - Expand StorageKey enum with DeveloperBalanceV1, DeveloperBalance(Address, Address), DeveloperMinBalance, PendingDeveloperMigration, StorageVersion - Add token field to DeveloperBalance, PaymentReceivedEvent, BalanceCreditedEvent, DeveloperWithdrawEvent, DeveloperForceCreditedEvent - Add missing error variants (MigrationSameAddress through MigrationBalanceChanged) - Add StorageEntryTtl, Severity, AdminBroadcast, AdminMigrationEvent types - Fix all single-arg StorageKey::DeveloperBalance(addr) calls to two-arg form - Remove duplicate get_storage_ttl function and stale injected code - Fix limits.rs path references (crate::lib::, crate::errors::, crate::types::) - Add token parameter to pagination::get_page - Add String import and module declarations (admin, limits, pagination, timelock) - Fix vault crate: add contracterror import, Meta->MetaKey, u16::MAX->u32::MAX, add missing token arg to settlement_client calls, remove duplicate functions, add validators module declaration
|
@GreatShinro Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes 53 pre-existing compile errors in
callora-settlementand 15 incallora-vaultby aligning the settlement crate's types with the V2 per-token refactoring defined intypes.rs.Changes
contracts/settlement/src/lib.rsStorageKeyenum — Expanded to matchtypes.rs: addedDeveloperBalanceV1(Address),DeveloperBalance(Address, Address),DeveloperMinBalance(Address),PendingDeveloperMigration(Address),StorageVersionDeveloperBalancestruct — Addedtoken: Addressfield (per-token accounting)token: AddresstoPaymentReceivedEvent,BalanceCreditedEvent,DeveloperWithdrawEvent,DeveloperForceCreditedEventSettlementError— Added 7 new variants:MigrationSameAddress,InvalidMigrationTarget,NoDeveloperBalance,TimelockOverflow,MigrationNotFound,TimelockNotExpired,MigrationBalanceChangedStorageEntryTtl,Severity,AdminBroadcast,AdminMigrationEventget_storage_ttl— Removed duplicate first implementation (contained stale injected code from pagination); kept the second complete version with USDC-aware per-token balance key lookupwithdraw_developer_balance— Moved USDC token lookup earlier; uses two-argStorageKey::DeveloperBalance(developer, usdc)for all balance storage operationsbatch_receive_payment— Removed stale single-argDeveloperBalancewrites; usesbalance_keyvariable consistentlyforce_credit_developer— Usesbalance_key(two-arg) for all storage operationsString,PendingDeveloperMigration(re-exported fromtimelock), added module declarations foradmin,limits,pagination,timelockcontracts/settlement/src/limits.rscrate::lib::CalloraSettlement→crate::CalloraSettlement,crate::errors::SettlementErrorandcrate::types::StorageKey→crate::{SettlementError, StorageKey}contracts/settlement/src/pagination.rstoken: Addressparameter toget_page()tokenfield toDeveloperBalancestruct constructionStorageKey::DeveloperBalance(address, token)for balance lookupcontracts/vault/src/lib.rscontracterrortosoroban_sdkimportsStorageKey::Meta→StorageKey::MetaKey(2 occurrences)max_fee_bpstype fromu16tou32(u16 not supported as Soroban contract parameter in SDK 22)u16::MAX→u32::MAXreferencestokenargument to twosettlement_client.receive_payment()callsget_max_deductfunctionbroadcastfunction (kept theErr()returning version overpanic!()version)mod validators;declarationcontracts/vault/tests/event_order.rs(new)Verification
callora-settlementcargo check --libcallora-vaultcargo check --libBreaking Changes
max_fee_bpsin vaultdeduct/batch_deductchanged fromu16tou32StorageKey::Metarenamed toStorageKey::MetaKeyStorageKey::DeveloperBalance(Address)→StorageKey::DeveloperBalance(Address, Address)(requires token parameter)DeveloperBalancestruct now requirestoken: AddressfieldPaymentReceivedEvent,BalanceCreditedEvent,DeveloperWithdrawEvent,DeveloperForceCreditedEventnow includetokenfieldcloses #532