View Issue Details

IDProjectCategoryView StatusLast Update
0011651Talerwallet-corepublic2026-09-16 11:16
ReporterFlorian Dold Assigned ToMarcS Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status feedbackResolutionopen 
Target Version1.8 
Summary0011651: wallet-core should tag amounts with scopeIdx
DescriptionThis allows us to concisely reference a scopeInfo and the corresponding currencySpec.

If some object has a scopeIdx field, the scope should apply to all amounts in that object.

When an object has amounts with fixed scopes, they *should* follow a naming schema such as `${field}ScopeIdx`.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Relationships

related to 0011798 integrating checkPayForTemplate should return amountAvailable 

Activities

Florian Dold

2026-09-07 11:34

manager   ~0029918

This approach also allows semi-automatic decoding in Swift:
```
  protocol ScopedAmountKeys: CodingKey {}

  extension KeyedDecodingContainer where Key: ScopedAmountKeys {
      func decode(_ type: Amount.Type, forKey key: Key) throws -> Amount {
          let amount = try Amount(from: superDecoder(forKey: key))

          for name in [key.stringValue + "ScopeIdx", "scopeIdx"] {
              if let scopeKey = Key(stringValue: name), contains(scopeKey) {
                  amount.scopeIdx = try decode(Int.self, forKey: scopeKey)
                  break
              }
          }
          return amount
      }

      // Include the similarly constrained decodeIfPresent overload
      // from the previous example for optional amounts.
  }

  struct Balance: Decodable {
      let scopeIdx: Int
      let available: Amount
      let pendingIncoming: Amount

      enum CodingKeys: String, ScopedAmountKeys {
          case scopeIdx, available, pendingIncoming
      }
  }
```

Issue History

Date ModifiedUsernameFieldChange
2026-07-20 12:20Florian DoldNew Issue
2026-08-04 23:17Christian GrothoffAssigned To => Florian Dold
2026-08-04 23:17Christian GrothoffStatusnew => implementing
2026-08-09 22:43Christian GrothoffTarget Version1.7 => 1.8
2026-09-07 11:19Florian DoldSummarywallet-core should tag currencies with scopeIdx => wallet-core should tag amounts with scopeIdx
2026-09-07 11:19Florian DoldDescription Updated
2026-09-07 11:34Florian DoldNote Added: 0029918
2026-09-10 21:46Florian DoldAssigned ToFlorian Dold => MarcS
2026-09-10 21:46Florian DoldStatusimplementing => feedback
2026-09-16 11:16MarcSRelationship addedrelated to 0011798