com.r3corda.contracts.asset / CommodityContract / deriveState

# deriveState

`fun deriveState(txState: TransactionState<State>, amount: Amount<Issued<Commodity>>, owner: PublicKey): TransactionState<State>`

Derive a new transaction state based on the given example, with amount and owner modified. This allows concrete implementations to have fields in their state which we dont know about here, and we simply leave them untouched when sending out "change" from spending/exiting.