-
Notifications
You must be signed in to change notification settings - Fork 12
/
attestations.go
33 lines (25 loc) · 1.38 KB
/
attestations.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package attestation
import (
"io"
"github.com/iotaledger/hive.go/ads"
"github.com/iotaledger/hive.go/runtime/module"
"github.com/iotaledger/iota-core/pkg/protocol/engine/blocks"
iotago "github.com/iotaledger/iota.go/v4"
)
type Attestations interface {
// Get returns the attestations that are included in the commitment of the given slot as list.
// If attestationCommitmentOffset=3 and commitment is 10, then the returned attestations are blocks from 7 to 10 that commit to at least 7.
Get(index iotago.SlotIndex) (attestations []*iotago.Attestation, err error)
// GetMap returns the attestations that are included in the commitment of the given slot as ads.Map.
// If attestationCommitmentOffset=3 and commitment is 10, then the returned attestations are blocks from 7 to 10 that commit to at least 7.
GetMap(index iotago.SlotIndex) (attestations ads.Map[iotago.Identifier, iotago.AccountID, *iotago.Attestation], err error)
AddAttestationFromValidationBlock(block *blocks.Block) error
Commit(index iotago.SlotIndex) (newCW uint64, attestationsRoot iotago.Identifier, err error)
Import(reader io.ReadSeeker) (err error)
Export(writer io.WriteSeeker, targetSlot iotago.SlotIndex) (err error)
Rollback(index iotago.SlotIndex) (err error)
// Reset resets the component to a clean state as if it was created at the last commitment.
Reset()
RestoreFromDisk() (err error)
module.Module
}