1 Commits

Author SHA1 Message Date
fiatjaf
57291497e6 Sequence.GetAttestation() 2023-10-02 08:45:39 -03:00

11
ots.go
View File

@@ -71,6 +71,17 @@ type Instruction struct {
type Sequence []Instruction
func (seq Sequence) GetAttestation() Attestation {
if len(seq) == 0 {
return Attestation{}
}
att := seq[len(seq)-1]
if att.Attestation == nil {
return Attestation{}
}
return *att.Attestation
}
func (seq Sequence) Compute(initial []byte) []byte {
current := initial
for _, inst := range seq {