You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CreateClaimableBalance.Validate() returns nil when Destinations is nil or an empty slice. stellar-core rejects such operations with CREATE_CLAIMABLE_BALANCE_MALFORMED (the doCheckValid guard checks claimants.empty()), so the SDK should catch this at build time.
Reproduce
op:=&txnbuild.CreateClaimableBalance{
Amount: "10.0000000",
Asset: txnbuild.NativeAsset{},
// Destinations intentionally omitted
}
err:=op.Validate()
fmt.Println(err) // <nil> -- should be a validation error
Root cause
The for _, d := range cb.Destinations loop in Validate() is a no-op when the slice is nil or empty, so the method falls through to the amount/asset checks and returns nil.
Note
js-stellar-base already validates this:
if(!Array.isArray(opts.claimants)||opts.claimants.length===0){thrownewError('must provide at least one claimant');}
Activity