proof

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 12 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	DefaultProofBlockRange       = 30
	DefaultProofBlockMinDuration = 300
	DefaultProofDuration         = 15 * 60 * time.Second
	DefaultHashProofTarget       = "0000"
	DefaultHashProofCount        = 60
)
View Source
const (
	AppOriginSD = "StableDiffusion"
)

Variables

This section is empty.

Functions

func ProofByCalcHash

func ProofByCalcHash(seed string, target string, timeout time.Duration) (types.Hash, []byte, error)

func ValidateHash

func ValidateHash(seed string, target string, bytes []byte) bool

Types

type EIP155Signer

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

func NewEIP155Signer

func NewEIP155Signer(forks crypto.ForksInTime, networkID uint64) *EIP155Signer

NewEIP155Signer returns a new EIP155Signer object

func (*EIP155Signer) CalculateV

func (e *EIP155Signer) CalculateV(parity byte) []byte

calculateV returns the V value for app provider signatures. Based on EIP155

func (*EIP155Signer) Hash

func (e *EIP155Signer) Hash(resp *EdgeResponse) types.Hash

Hash is a wrapper function that calls calcCallHash with the EIP155Signer's networkID

func (*EIP155Signer) Provider

func (e *EIP155Signer) Provider(resp *EdgeResponse) (types.Address, error)

Provider returns the telegram provider

func (*EIP155Signer) SignEdgeResp

func (e *EIP155Signer) SignEdgeResp(
	resp *EdgeResponse,
	privateKey *ecdsa.PrivateKey,
) (*EdgeResponse, error)

SignMsg signs the transaction using the passed in private key

type EdgeResponse

type EdgeResponse struct {
	RespString string
	V          *big.Int
	R          *big.Int
	S          *big.Int
	From       types.Address

	Hash types.Hash
}

func (*EdgeResponse) Copy

func (r *EdgeResponse) Copy() *EdgeResponse

func (*EdgeResponse) MarshalRLP

func (r *EdgeResponse) MarshalRLP() []byte

func (*EdgeResponse) MarshalRLPTo

func (r *EdgeResponse) MarshalRLPTo(dst []byte) []byte

func (*EdgeResponse) MarshalRLPWith

func (r *EdgeResponse) MarshalRLPWith(arena *fastrlp.Arena) *fastrlp.Value

MarshalRLPWith marshals the EdgeResponse to RLP with a specific fastrlp.Arena

func (*EdgeResponse) UnmarshalRLP

func (r *EdgeResponse) UnmarshalRLP(input []byte) error

type Signer

type Signer interface {
	// Hash returns the hash of the transaction
	Hash(resp *EdgeResponse) types.Hash

	// Provider returns the provider of the edge call request
	Provider(resp *EdgeResponse) (types.Address, error)

	// SignMsg signs a transaction
	SignEdgeResp(resp *EdgeResponse, priv *ecdsa.PrivateKey) (*EdgeResponse, error)

	// CalculateV calculates the V value based on the type of signer used
	CalculateV(parity byte) []byte
}

Signer is a utility interface used to recover data from a rtc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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