vochaintx

package
v1.10.1 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TxKey

func TxKey(tx []byte) [32]byte

TxKey computes the checksum of the tx

Types

type TokenTransfer

type TokenTransfer struct {
	FromAddress common.Address
	ToAddress   common.Address
	Amount      uint64
	TxHash      []byte
}

TokenTransfer wraps information about a token transfer.

type Tx added in v1.8.0

type Tx struct {
	Tx          *models.Tx
	SignedBody  []byte
	Signature   []byte
	TxID        [32]byte
	TxModelType string
}

Tx is a wrapper around a protobuf transaction with some helpers

func (*Tx) Unmarshal added in v1.8.0

func (tx *Tx) Unmarshal(content []byte, chainID string) error

Unmarshal decodes the content of a serialized transaction into the Tx struct.

The function determines the type of the transaction using Protocol Buffers reflection and sets it to the TxModelType field. Extracts the signature. Prepares the signed body (ready to be checked) and computes the transaction ID (a hash of the data).

Jump to

Keyboard shortcuts

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