Documentation ¶
Index ¶
- Variables
- func ConvertUnmarshalledInt(x interface{}) (int64, error)
- func DirectoryExists(directoryPath string) bool
- func GetTerminationSignalCh() <-chan os.Signal
- func Max(a, b uint64) uint64
- func Min(a, b uint64) uint64
- func PadLeftOrTrim(bb []byte, size int) []byte
- func SetupDataDir(dataDir string, paths []string) error
- func ToFixedFloat(num float64, precision int) float64
- type JSONNumber
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MaxSafeJSInt represents max value which JS support // It is used for smartContract fields // Our staking repo is written in JS, as are many other clients // If we use higher value JS will not be able to parse it MaxSafeJSInt = uint64(math.Pow(2, 53) - 2) )
Functions ¶
func ConvertUnmarshalledInt ¶
func DirectoryExists ¶
DirectoryExists checks if the directory at the specified path exists
func GetTerminationSignalCh ¶
GetTerminationSignalCh returns a channel to emit signals by ctrl + c
func PadLeftOrTrim ¶
PadLeftOrTrim left-pads the passed in byte array to the specified size, or trims the array if it exceeds the passed in size
func SetupDataDir ¶
SetupDataDir sets up the data directory and the corresponding sub-directories
func ToFixedFloat ¶
Types ¶
type JSONNumber ¶
type JSONNumber struct {
Value uint64
}
JSONNumber is the number represented in decimal or hex in json
func (*JSONNumber) MarshalJSON ¶
func (d *JSONNumber) MarshalJSON() ([]byte, error)
func (*JSONNumber) UnmarshalJSON ¶
func (d *JSONNumber) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.