File tree Expand file tree Collapse file tree 2 files changed +8
-12
lines changed
Expand file tree Collapse file tree 2 files changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -159,11 +159,9 @@ func NewBuyRequestFromWire(wireMsg WireMessage,
159159// Validate ensures that the buy request is valid.
160160func (q * BuyRequest ) Validate () error {
161161 // Ensure that the asset specifier is set.
162- //
163- // TODO(ffranr): For now, the asset ID must be set. We do not currently
164- // support group keys.
165- if ! q .AssetSpecifier .HasId () {
166- return fmt .Errorf ("asset id not specified in BuyRequest" )
162+ err := q .AssetSpecifier .AssertNotEmpty ()
163+ if err != nil {
164+ return err
167165 }
168166
169167 // Ensure that the message version is supported.
@@ -173,7 +171,7 @@ func (q *BuyRequest) Validate() error {
173171 }
174172
175173 // Ensure that the suggested asset rate has not expired.
176- err : = fn .MapOptionZ (q .AssetRateHint , func (rate AssetRate ) error {
174+ err = fn .MapOptionZ (q .AssetRateHint , func (rate AssetRate ) error {
177175 if rate .Expiry .Before (time .Now ()) {
178176 return fmt .Errorf ("suggested asset rate has expired" )
179177 }
Original file line number Diff line number Diff line change @@ -152,12 +152,10 @@ func NewSellRequestFromWire(wireMsg WireMessage,
152152
153153// Validate ensures that the quote request is valid.
154154func (q * SellRequest ) Validate () error {
155- // Ensure that the asset specifier is set.
156- //
157- // TODO(ffranr): For now, the asset ID must be set. We do not currently
158- // support group keys.
159- if ! q .AssetSpecifier .HasId () {
160- return fmt .Errorf ("asset id not specified in SellRequest" )
155+ // Ensure that the asset specifier is not empty.
156+ err := q .AssetSpecifier .AssertNotEmpty ()
157+ if err != nil {
158+ return err
161159 }
162160
163161 // Ensure that the message version is supported.
You can’t perform that action at this time.
0 commit comments