shared

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddressConverter, _ = addressConverters.NewPlainAddressConverter(32, "0x")

Functions

func CreateEmptyAddress

func CreateEmptyAddress() state.AddressContainer

CreateEmptyAddress creates an empty address

func ReadPrivateKeyFromPemText

func ReadPrivateKeyFromPemText(pemText string) (crypto.PrivateKey, error)

ReadPrivateKeyFromPemText reads a private key from a string

func ReturnBadRequest

func ReturnBadRequest(context *gin.Context, errScope string, err error)

ReturnBadRequest returns a "bad request" response

func ReturnOkResponse

func ReturnOkResponse(context *gin.Context, data interface{})

ReturnOkResponse returns an "ok" response

Types

type SignedTransaction

type SignedTransaction struct {
	Nonce     uint64 `json:"nonce"`
	Value     string `json:"value"`
	Receiver  string `json:"receiver"`
	Sender    string `json:"sender"`
	GasPrice  uint64 `json:"gasPrice"`
	GasLimit  uint64 `json:"gasLimit"`
	Data      string `json:"data"`
	Signature string `json:"signature"`
	Bytes     []byte
}

SignedTransaction is a signed transaction

func NewSignedTransaction

func NewSignedTransaction(tx *transaction.Transaction, privateKey crypto.PrivateKey) (*SignedTransaction, error)

NewSignedTransaction creates as signed transaction

Jump to

Keyboard shortcuts

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