varint::encode_to_vec(symbol.into(), &mut payload);
}
if let Some(limit) = etching.limit {
varint::encode_to_vec(TAG_LIMIT, &mut payload);
varint::encode_to_vec(limit, &mut payload);
}
if let Some(term) = etching.term {
varint::encode_to_vec(TAG_TERM, &mut payload);
varint::encode_to_vec(term.into(), &mut payload);
}
}
if self.burn {
varint::encode_to_vec(TAG_BURN, &mut payload);
varint::encode_to_vec(0, &mut payload);
}
if !self.edicts.is_empty() {
varint::encode_to_vec(TAG_BODY, &mut payload);
let mut edicts = self.edicts.clone();
edicts.sort_by_key(|edict| edict.id);
let mut id = 0;
for edict in edicts {
varint::encode_to_vec(edict.id - id, &mut payload);
varint::encode_to_vec(edict.amount, &mut payload);
varint::encode_to_vec(edict.output, &mut payload);
id = edict.id;
}
}
let mut builder = script::Builder::new()
.push_opcode(opcodes::all::OP_RETURN)