aurora-rs / stellar-base-rs

Low level Stellar types for Rust.
https://docs.rs/stellar-base
Apache License 2.0
8 stars 6 forks source link

fix: Change trust limit #8

Closed aidan46-crypto closed 11 months ago

aidan46-crypto commented 1 year ago

Issue

There is no way to remove a trust line.

Fix

Update the change trust operation limit check to allow a 0 limit, to be able to remove trust lines. This fix is trivial, update the limit check in the ChangeTrustOprationBuilder build() function.

// Change `<=` to `<` to be able to remove trust lines
if limit.to_i64() <= 0 { 
    return Err(Error::InvalidOperation(
        "change trust limit must be positive".to_string(),
    ));
}
bjorn commented 11 months ago

@aidan46-crypto Would you update this PR with a slightly adjusted error message, and sign-off your commit so CI will pass (it needs to also be rebased after #6 is merged)? I am not able to change the PR myself (maybe you could enable me to push to your master for this PR, but I'm not sure if GitHub allows this). If not, I would just manually re-apply the fix.

bjorn commented 11 months ago

Since we can't move forward with this PR without @aidan46-crypto, I've opened #11 as a replacement.