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
This issue describes the limitations and drawbacks of the current design of build package. I'm not sure if we want to rearchitect it or just improve the current state - we should discuss it here.
Around 50% of methods accept interface{} type argument. It's not clear what to use, it's super easy to pass something that doesn't match (and it won't be detected at compilation time).
Operation builders are really hard to use as it's not clear which parameters are required and which optional. Example: Payment(muts ...interface{}) (result PaymentBuilder). It should be clear how to use by looking at the method definition - without checking the docs. So probably something like: Payment(destination string, amount string, asset Asset, opts ...PaymentMutator) or:
Exactly the same thing as above but when creating transaction.
It's not possible to build a transaction builder from a serialized transaction. Ex. I want to add a new/modify/remove operation or add a second signature.
Saving errors on struct instead of returning them. This results in a code that makes it super easy to forget to handle errors (and you can't catch it using static analysis):
someObject.SomeFunction() // Error stored in `someObject.Err`// You need to remember to check someObject.Err here// as SomeFunction() definition says nothing about errors.
After a lot of discussion, we decided to produce a new library to address these concerns. txnbuild is now released. It is the replacement for build, and resolves the problems described in this issue.
This issue describes the limitations and drawbacks of the current design of
build
package. I'm not sure if we want to rearchitect it or just improve the current state - we should discuss it here.interface{}
type argument. It's not clear what to use, it's super easy to pass something that doesn't match (and it won't be detected at compilation time).Payment(muts ...interface{}) (result PaymentBuilder)
. It should be clear how to use by looking at the method definition - without checking the docs. So probably something like:Payment(destination string, amount string, asset Asset, opts ...PaymentMutator)
or:xdr
package structs and use them instead of mirroring transaction related structs here?The text was updated successfully, but these errors were encountered: