digest

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLIENT_ADDRESS_SIZE_BYTES    = 20
	CLIENT_ADDRESS_SHA256_OFFSET = hash.SHA256_HASH_SIZE_BYTES - CLIENT_ADDRESS_SIZE_BYTES
)
View Source
const (
	NODE_ADDRESS_SIZE_BYTES = 20
)
View Source
const (
	TX_ID_SIZE_BYTES = 8 + 32
)

Variables

This section is empty.

Functions

func CalcBlockHash added in v0.7.1

func CalcBlockHash(transactionsBlock *protocol.TransactionsBlockContainer, resultsBlock *protocol.ResultsBlockContainer) primitives.Sha256

func CalcClientAddressOfContract added in v0.7.11

func CalcClientAddressOfContract(contractName primitives.ContractName) (primitives.ClientAddress, error)

TODO(v1): add argument (spec feature)

func CalcClientAddressOfEd25519PublicKey added in v0.7.11

func CalcClientAddressOfEd25519PublicKey(publicKey primitives.Ed25519PublicKey) (primitives.ClientAddress, error)

func CalcClientAddressOfEd25519Signer added in v0.7.11

func CalcClientAddressOfEd25519Signer(signer *protocol.Signer) (primitives.ClientAddress, error)

func CalcContractStateDiffHash added in v0.7.11

func CalcContractStateDiffHash(stateDiff *protocol.ContractStateDiff) primitives.Sha256

func CalcNewBlockTimestamp added in v0.7.11

func CalcNewBlockTimestamp(prevBlockTimestamp primitives.TimestampNano, now primitives.TimestampNano) primitives.TimestampNano

func CalcNodeAddressFromPublicKey added in v0.7.1

func CalcNodeAddressFromPublicKey(publicKey primitives.EcdsaSecp256K1PublicKey) primitives.NodeAddress

func CalcQueryHash added in v0.7.11

func CalcQueryHash(query *protocol.Query) primitives.Sha256

func CalcReceiptHash

func CalcReceiptHash(receipt *protocol.TransactionReceipt) primitives.Sha256

func CalcReceiptHashes added in v0.7.1

func CalcReceiptHashes(receipts []*protocol.TransactionReceipt) []primitives.Sha256

func CalcReceiptsMerkleRoot added in v0.7.11

func CalcReceiptsMerkleRoot(receipts []*protocol.TransactionReceipt) (primitives.Sha256, error)

func CalcResultsBlockHash

func CalcResultsBlockHash(resultsBlock *protocol.ResultsBlockContainer) primitives.Sha256

func CalcSignedTxHashes added in v0.7.1

func CalcSignedTxHashes(signedTransactions []*protocol.SignedTransaction) []primitives.Sha256

func CalcStateDiffHash added in v0.7.11

func CalcStateDiffHash(stateDiffs []*protocol.ContractStateDiff) (primitives.Sha256, error)

func CalcTransactionMetaDataHash added in v0.7.11

func CalcTransactionMetaDataHash(metaData *protocol.TransactionsBlockMetadata) primitives.Sha256

func CalcTransactionsBlockHash

func CalcTransactionsBlockHash(transactionsBlock *protocol.TransactionsBlockContainer) primitives.Sha256

func CalcTransactionsMerkleRoot added in v0.7.11

func CalcTransactionsMerkleRoot(txs []*protocol.SignedTransaction) (primitives.Sha256, error)

func CalcTxHash

func CalcTxHash(transaction *protocol.Transaction) primitives.Sha256

func CalcTxHashsFromSignedTransactions added in v0.7.11

func CalcTxHashsFromSignedTransactions(transactions []*protocol.SignedTransaction) []primitives.Sha256

func CalcTxId

func CalcTxId(transaction *protocol.Transaction) []byte

func ExtractTxId

func ExtractTxId(txId []byte) (txHash primitives.Sha256, txTimestamp primitives.TimestampNano, err error)

func GenerateTxId

func GenerateTxId(txHash primitives.Sha256, txTimestamp primitives.TimestampNano) []byte

func GetBlockSignersFromReceiptProof added in v0.7.11

func GetBlockSignersFromReceiptProof(packedProof primitives.PackedReceiptProof) ([]primitives.NodeAddress, error)

func SignAsNode added in v0.7.1

don't need to provide hashed data as this function will SHA256

func VerifyNodeSignature added in v0.7.1

func VerifyNodeSignature(nodeAddress primitives.NodeAddress, data []byte, sig primitives.EcdsaSecp256K1Sig) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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