database

package
v0.0.0-...-f0b25c7 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package database handles all the lower level support for maintaining the blockchain in storage and maintaining an in -memory database of account info.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountID AccountID
	Nonce     uint64
	Balance   uint64
}

Account represents info stored in the database for an infividual account.

type AccountID

type AccountID string

AccountID represents an account id that is used to sign transactions and is associated with transactions on the blockchain.

func ToAccountID

func ToAccountID(hex string) (AccountID, error)

ToAccountID converts a hex-encoded string to an account and validated the hex-encoded string is formatted correctly.

func (AccountID) IsAccountID

func (a AccountID) IsAccountID() bool

IsAccountID verifies whether the underlying data reprepresents a valid hex-encoded account.

type Database

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

Database manages data related to accounts who have transacted on the blockchain.

Jump to

Keyboard shortcuts

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