Documentation ¶
Index ¶
- Constants
- Variables
- func Byte32ToSlice(in [32]byte) []byte
- func ByteFixedToBigInt(bytes []byte, size int) *big.Int
- func ByteSliceToBigInt(slice []byte) *big.Int
- func CheckMultiple32BytesFilled(b []byte, bs ...[]byte) bool
- func ContainsBigIntInSlice(value *big.Int, list []*big.Int) bool
- func GetCentLogFormat() string
- func IsEmptyAddress(addr common.Address) bool
- func IsEmptyByte32(source [32]byte) bool
- func IsEmptyByteSlice(s []byte) bool
- func IsSameByteSlice(a []byte, b []byte) bool
- func IsStringEmpty(msg string) bool
- func IsStringOfLength(msg string, n int) bool
- func IsValidByteSliceForLength(slice []byte, length int) bool
- func LookForEvent(iter EventIterator) (err error)
- func RandomByte32() (out [32]byte)
- func RandomSlice(size int) (out []byte)
- func ReadKeyFromPemFile(fileName, keyPurpose string) (key []byte, err error)
- func SendPOSTRequest(url string, contentType string, payload []byte) (statusCode int, err error)
- func SimulateJSONDecodeForGocelery(kwargs map[string]interface{}) (map[string]interface{}, error)
- func SliceOfByteSlicesToHexStringSlice(byteSlices [][]byte) []string
- func SliceToByte32(in []byte) (out [32]byte, err error)
- func ToTimestamp(time time.Time) *timestamp.Timestamp
- func WriteKeyToPemFile(fileName string, keyPurpose string, key []byte) error
- type EventIterator
Constants ¶
const ( PublicKey = "PUBLIC KEY" PrivateKey = "PRIVATE KEY" )
Constants that are common across packages.
Variables ¶
var ErrEventNotFound = fmt.Errorf("event not found")
ErrEventNotFound when event is not found and need to retry
Functions ¶
func Byte32ToSlice ¶
Byte32ToSlice converts a [32]bytes to an unbounded byte array
func ByteFixedToBigInt ¶
ByteFixedToBigInt convert arbitrary length byte arrays to big.Int
func ByteSliceToBigInt ¶
ByteSliceToBigInt convert bute slices to big.Int (bigendian)
func CheckMultiple32BytesFilled ¶
CheckMultiple32BytesFilled takes multiple []byte slices and ensures they are all of length 32 and don't contain all 0x0 bytes.
func ContainsBigIntInSlice ¶
ContainsBigIntInSlice checks if value is present in list.
func GetCentLogFormat ¶
func GetCentLogFormat() string
GetCentLogFormat returns the specific log format
func IsEmptyAddress ¶
IsEmptyAddress checks if the addr is empty.
func IsEmptyByte32 ¶
IsEmptyByte32 checks if the source is empty.
func IsEmptyByteSlice ¶
IsEmptyByteSlice checks if the provided slice is empty returns true if: s == nil every element is == 0
func IsSameByteSlice ¶
IsSameByteSlice checks if a and b contains same bytes.
func IsStringEmpty ¶
IsStringEmpty returns true if the string is empty
func IsStringOfLength ¶
IsStringOfLength returns true if length of the string == n
func IsValidByteSliceForLength ¶
IsValidByteSliceForLength checks if the len(slice) == length.
func LookForEvent ¶
func LookForEvent(iter EventIterator) (err error)
LookForEvent checks if the iterator is ready with the Event if no event is found, returns ErrEventNotFound returns iter.Error when iterator errored out
func RandomByte32 ¶
func RandomByte32() (out [32]byte)
RandomByte32 returns a randomly filled byte array with length of 32
func RandomSlice ¶
RandomSlice returns a randomly filled byte array with length of given size
func ReadKeyFromPemFile ¶
ReadKeyFromPemFile reads the pem file and returns the key with matching key purpose
func SendPOSTRequest ¶
SendPOSTRequest sends post with data to given URL.
func SimulateJSONDecodeForGocelery ¶
SimulateJSONDecodeForGocelery encodes and decodes the kwargs.
func SliceOfByteSlicesToHexStringSlice ¶
SliceOfByteSlicesToHexStringSlice converts the given slice of byte slices to a hex encoded string array with 0x prefix
func SliceToByte32 ¶
SliceToByte32 converts a 32 byte slice to an array. Will thorw error if the slice is too long
func ToTimestamp ¶
ToTimestamp converts time.Time to timestamp.TimeStamp.
Types ¶
type EventIterator ¶
EventIterator contains functions that make events listening more easier