Skip to content

coin_ins not populated for spell inputs with empty charms #149

@AndeLabs

Description

@AndeLabs

Environment: Charms v8, charms-sdk 0.10.0

Observed behavior:
When a spell input has charms: {} (raw BTC without charms), tx.coin_ins is not populated. This results in coin_ins being empty/None even when BTC is present in the spell input.

Example spell input:

ins:
  - utxo_id: abc123...:0
    charms: {}  # Raw BTC, no charms attached

In the app contract, tx.coin_ins is empty for this input.

Expected behavior:
Unclear - is coin_ins expected to reflect all BTC inputs, or only those with charms?

Workaround:
Skip validation when coin_ins is not populated:

if btc_inputs > 0 && btc_inputs < required_amount {
    return Err(...);
}

Question:
Is this intentional behavior? What's the recommended pattern for validating BTC collateral in contracts when spell inputs have charms: {}?

Would appreciate clarification or documentation update on when coin_ins is populated.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions