rust-nostr/nostr

Job Feedback events with status PROCESSING require 'amount' tag (and they shouldn't)

dtdannen opened this issue · 0 comments

Describe the bug

When creating a Job Feedback request with status PROCESSING, it's not clear how to exclude the amount tag in the final event. Right now the code requires that 'amount_millisats' be provided, and if using a value of 0, it shows up in the final event.

To Reproduce

feedback_event = EventBuilder.job_feedback(job_request=request_event,
                                                   status=DataVendingMachineStatus.PROCESSING,
                                                   extra_info=None,
                                                   amount_millisats=0).to_event(self.keys)
await self.client.send_event(feedback_event)

produces this event:

{
  "id": "3ee824bc4897d2b8d64561cefcd23f42f2a19ea9ecad2a1bc3b0c843c1ff07c0",
  "pubkey": "[1a9be38c70a8c0831badcac3ebcfeb46f90a0d57f9a65fa55e3f143e6ddc85a3](https://dvmdash.live/dvm/1a9be38c70a8c0831badcac3ebcfeb46f90a0d57f9a65fa55e3f143e6ddc85a3/)",
  "created_at": 1724599529,
  "kind": 7000,
  "tags": [
    [
      "status",
      "processing"
    ],
    [
      "e",
      "[3789c7c8d1981788f0cc41ecf2abf870961a9da365e047f3eb90bcb48eea8ffb](https://dvmdash.live/event/3789c7c8d1981788f0cc41ecf2abf870961a9da365e047f3eb90bcb48eea8ffb/)"
    ],
    [
      "p",
      "[da18e9860040f3bf493876fc16b1a912ae5a6f6fa8d5159c3de2b8233a0d9851](https://dvmdash.live/npub/da18e9860040f3bf493876fc16b1a912ae5a6f6fa8d5159c3de2b8233a0d9851/)"
    ],
    [
      "amount",
      "0"
    ]
  ],
  "content": "",
  "sig": "0cb38fff7eb5698172995febdd02fd8c974594aa950babb499c4eec762128abf9caaf168d95e2372a950bc7371d62bb5bfa945d51e4ca99cce938338f8d78a79"
}

https://dvmdash.live/event/3ee824bc4897d2b8d64561cefcd23f42f2a19ea9ecad2a1bc3b0c843c1ff07c0/

Expected behavior

Instead it should create an event without the tag ["amount", "0"]

Build environment

  • Library: nostr_sdk
  • Language: Python
  • Language version: python3.12
  • Tag/commit: 0.34.0
  • OS+version: macOS apple silicon

Additional context