TypedInput interface {
InputType() uint8
AssetID() bc.AssetID
- readCommitment(*blockchain.Reader) (bc.AssetID, error)
- readWitness(*blockchain.Reader, bc.AssetID) error
+ readCommitment(*blockchain.Reader) error
+ readWitness(*blockchain.Reader) error
writeCommitment(io.Writer, uint64) error
writeWitness(w io.Writer) error
}
)
-var errBadAssetID = errors.New("asset ID does not match other issuance parameters")
-
// Amount return the asset amount of the txinput
func (t *TxInput) Amount() uint64 {
switch inp := t.TypedInput.(type) {
return err
}
- var assetID bc.AssetID
t.CommitmentSuffix, err = blockchain.ReadExtensibleString(r, func(r *blockchain.Reader) error {
if t.AssetVersion != 1 {
return nil
return err
}
- assetID, err = t.readCommitment(r)
- return err
+ return t.readCommitment(r)
})
if err != nil {
return err
t.WitnessSuffix, err = blockchain.ReadExtensibleString(r, func(r *blockchain.Reader) error {
if t.AssetVersion == 1 {
- return t.readWitness(r, assetID)
+ return t.readWitness(r)
}
return nil