Documentation ¶
Index ¶
- func ExchangeAndUpdateAccounts(dbConnection *sql.DB, c *contracts.Contract) error
- func GetAccountInfo(dbConnection *sql.DB, pkhash []byte) (*accountinfo.AccountInfo, error)
- func GetBalance(dbConnection *sql.DB, pkhash []byte) (uint64, error)
- func GetStateNonce(dbConnection *sql.DB, pkhash []byte) (uint64, error)
- func InsertAccountIntoAccountBalanceTable(dbConnection *sql.DB, pkhash []byte, value uint64) error
- func MintAurumUpdateAccountBalanceTable(dbConnection *sql.DB, pkhash []byte, value uint64) error
- func UpdateAccountTable(db *sql.DB, b *block.Block) error
- type Connection
- func (c *Connection) ExchangeAndUpdateAccounts(contract *contracts.Contract) error
- func (c *Connection) GetAccountInfo(pkhash []byte) (*accountinfo.AccountInfo, error)
- func (c *Connection) GetBalance(pkhash []byte) (uint64, error)
- func (c *Connection) GetStateNonce(pkhash []byte) (uint64, error)
- func (c *Connection) InsertAccountIntoAccountBalanceTable(pkhash []byte, value uint64) error
- func (c *Connection) Lock()
- func (c *Connection) MintAurumUpdateAccountBalanceTable(pkhash []byte, value uint64) error
- func (c *Connection) Unlock()
- func (c *Connection) UpdateAccountTable(b *block.Block) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExchangeAndUpdateAccounts ¶
Deduct value from sender's balance Add value to recipient's balance Increment both nonces by 1
func GetAccountInfo ¶
func GetAccountInfo(dbConnection *sql.DB, pkhash []byte) (*accountinfo.AccountInfo, error)
func InsertAccountIntoAccountBalanceTable ¶
Insert into account balance table Value set to value paramter Nonce set to zero Public Key Hash insert into pkhash column
Return every error possible with an explicit message
func MintAurumUpdateAccountBalanceTable ¶
Add value to pkhash's balanace Increment nonce by 1
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection struct used receiver call on a sql.DB with mutex support
func (*Connection) ExchangeAndUpdateAccounts ¶
func (c *Connection) ExchangeAndUpdateAccounts(contract *contracts.Contract) error
ExchangeAndUpdateAccounts calls Connection.ExchangeAndUpdateAccounts using struct connection
func (*Connection) GetAccountInfo ¶
func (c *Connection) GetAccountInfo(pkhash []byte) (*accountinfo.AccountInfo, error)
GetAccountInfo calls Connection.GetAccountInfo using struct connection
func (*Connection) GetBalance ¶
func (c *Connection) GetBalance(pkhash []byte) (uint64, error)
GetBalance locks access and calls Connection.GetBalance using struct connection
func (*Connection) GetStateNonce ¶
func (c *Connection) GetStateNonce(pkhash []byte) (uint64, error)
GetStateNonce calls Connection.GetStateNonce using struct connection
func (*Connection) InsertAccountIntoAccountBalanceTable ¶
func (c *Connection) InsertAccountIntoAccountBalanceTable(pkhash []byte, value uint64) error
InsertAccountIntoAccountBalanceTable calls Connection.InsertAccountIntoAccountBalanaceTable using struct connection
func (*Connection) Lock ¶
func (c *Connection) Lock()
Lock locks Connection for writing. If the lock is already locked for writing, Lock blocks until the lock is available.
func (*Connection) MintAurumUpdateAccountBalanceTable ¶
func (c *Connection) MintAurumUpdateAccountBalanceTable(pkhash []byte, value uint64) error
MintAurumUpdateAccountBalanceTable calls Connection.MintAurumUpdateAccountBalanceTable using struct connection
func (*Connection) Unlock ¶
func (c *Connection) Unlock()
Unlock unlocks Connection for writing. It is a run-time error if at is not locked for writing on entry to Unlock.
func (*Connection) UpdateAccountTable ¶
func (c *Connection) UpdateAccountTable(b *block.Block) error
UpdateAccountTable calls Connection.UpdateAccountTable using struct connection