Documentation ¶
Overview ¶
Package medley provides some functions that may be useful in various parts of shutter
Index ¶
- func BindFlags(cmd *cobra.Command) error
- func CloneWithGob(src, dst interface{})
- func DedupAddresses(addrs []common.Address) []common.Address
- func EnsureUniqueAddresses(addrs []common.Address) error
- func FindAddressIndex(addresses []common.Address, addr common.Address) (int, error)
- func GetRevertReason(ctx context.Context, b ethereum.ContractCaller, from common.Address, ...) error
- func ShowHelpAndExit(cmd *cobra.Command, args []string)
- func Sleep(ctx context.Context, d time.Duration)
- func WaitMined(ctx context.Context, client *ethclient.Client, txHash common.Hash) (*types.Receipt, error)
- func WaitMinedMany(ctx context.Context, client *ethclient.Client, txHashes []common.Hash) ([]*types.Receipt, error)
- type ChecksumAddr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindFlags ¶
BindFlags automatically sets options to command line flags from environment variables.
func CloneWithGob ¶
func CloneWithGob(src, dst interface{})
CloneWithGob clones the given object by serializing/deserializing with gob.
func DedupAddresses ¶
DedupAddresses returns a new slice containing only unique addresses.
func EnsureUniqueAddresses ¶
EnsureUniqueAddresses makes sure the slice of addresses doesn't contain duplicate addresses.
func FindAddressIndex ¶
FindAddressIndex returns the index of the given address inside the slice of addresses or returns an error, if the slice does not contain the given address.
func GetRevertReason ¶
func GetRevertReason(ctx context.Context, b ethereum.ContractCaller, from common.Address, tx *types.Transaction, blockNum *big.Int) error
GetRevertReason returns the reason for a failed transaction.
func ShowHelpAndExit ¶
ShowHelpAndExit shows the commands help message and exits the program with status 1.
Types ¶
type ChecksumAddr ¶
ChecksumAddr is used internally to serialize addresses as checksum addresses when writing JSON files.
func (ChecksumAddr) MarshalJSON ¶
func (addr ChecksumAddr) MarshalJSON() ([]byte, error)
func (*ChecksumAddr) UnmarshalJSON ¶
func (addr *ChecksumAddr) UnmarshalJSON(data []byte) error