client

package
v0.0.0-...-17429b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitcoinAttestationVerifier

type BitcoinAttestationVerifier struct {
	// contains filtered or unexported fields
}

A BitcoinAttestationVerifier uses a bitcoin RPC connection to verify bitcoin headers.

func NewBitcoinAttestationVerifier

func NewBitcoinAttestationVerifier(
	c *btcrpcclient.Client,
) *BitcoinAttestationVerifier

func (*BitcoinAttestationVerifier) BitcoinVerifications

func (v *BitcoinAttestationVerifier) BitcoinVerifications(
	t *opentimestamps.Timestamp,
) (res []BitcoinVerification)

BitcoinVerifications returns the all bitcoin attestation results for the timestamp.

func (*BitcoinAttestationVerifier) Verify

func (v *BitcoinAttestationVerifier) Verify(
	t *opentimestamps.Timestamp,
) (ret *time.Time, err error)

Verify returns the earliest bitcoin-attested time, or nil if none can be found or verified successfully.

func (*BitcoinAttestationVerifier) VerifyAttestation

func (v *BitcoinAttestationVerifier) VerifyAttestation(
	digest []byte, a *opentimestamps.BitcoinAttestation,
) (*time.Time, error)

VerifyAttestation checks a BitcoinAttestation using a given hash digest. It returns the time of the block if the verification succeeds, an error otherwise.

type BitcoinVerification

type BitcoinVerification struct {
	Timestamp       *opentimestamps.Timestamp
	Attestation     *opentimestamps.BitcoinAttestation
	AttestationTime *time.Time
	Error           error
}

A BitcoinVerification is the result of verifying a BitcoinAttestation

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL