Skip to content

Instantly share code, notes, and snippets.

View F0rzend's full-sized avatar

F0rzend F0rzend

View GitHub Profile
package domain
type Name struct {
value string
}
func NewName(name string) (Name, error) {
if len(name) < 3 || len(name) > 100 {
return Name{}, fmt.Errorf("%w: name length must be less than 3 and gather than 100", ErrInvalidNameLength)
}
@F0rzend
F0rzend / utils.go
Created April 12, 2023 00:46
go-ethereum errors handling utilities
package utils
import (
"bytes"
"context"
"crypto/ecdsa"
"github.com/ethereum/go-ethereum/accounts/abi"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/rpc"
"math/big"