proof

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProof

func GetProof(c *gin.Context)

GetProof will receive a rootHash and an address from the client, and it will return the Merkle proof

func GetProofCurrentRootHash

func GetProofCurrentRootHash(c *gin.Context)

GetProofCurrentRootHash will receive an address from the client, and it will return the Merkle proof for the current root hash

func Routes

func Routes(router *wrapper.RouterWrapper)

Routes defines Merkle proof related routes

func VerifyProof

func VerifyProof(c *gin.Context)

VerifyProof will receive a rootHash, an address and a Merkle proof from the client, and it will verify the proof

Types

type FacadeHandler

type FacadeHandler interface {
	GetProof(rootHash string, address string) ([][]byte, error)
	GetProofCurrentRootHash(address string) ([][]byte, []byte, error)
	VerifyProof(rootHash string, address string, proof [][]byte) (bool, error)
}

FacadeHandler interface defines methods that can be used by the gin webserver

type VerifyProofRequest

type VerifyProofRequest struct {
	RootHash string   `json:"roothash"`
	Address  string   `json:"address"`
	Proof    []string `json:"proof"`
}

VerifyProofRequest represents the parameters needed to verify a Merkle proof

Jump to

Keyboard shortcuts

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