Skip to content

[bug]: AddAssetSellOrder requires peer_pub_key whiles mentions it as optional in the proto docs #1773

@tee8z

Description

@tee8z

Background

While working through calling the AddAssetSellOrder rpc and using the docs as a guide, I've found the peer_pub_key in reality is a required field while documented as optional:

Your environment

This was running tapd version "0.6.1-alpha commit=v0.6.1", lnd version "0.19.3-beta" and litd version "0.15.2-alpha". Tapd is being run as a subprocess to litd.

Steps to reproduce

The documentation for the proto messages lives here:

bytes peer_pub_key = 4;

The logic which doesn't follow that documentation lives here:

// Currently, we require the peer to be specified in the buy order.

It is interesting that the unmarshaling correctly (as based on the docs) handles the peer pubkey as optional:

var peer fn.Option[route.Vertex]

Additionally, the comments above where the error occurs also seem to be talking about a buy order while we are in the sell order logic.

Expected behavior

Either the documentation should be updated to explain that the peer pubkey is required for a sell order, or the logic on handling that rpc command should match with it being optional.

Actual behavior

Documentation and code are out of sync and we get back the error "sell order peer must be specified" when trying to request a sell order without providing the peer pubkey to use.

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions