26 lines
463 B
Go
26 lines
463 B
Go
// Package bindings provides utilities for working with Ethereum contract bindings
|
|
package bindings
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/ethereum/go-ethereum/accounts/abi"
|
|
)
|
|
|
|
// Fixed type mismatch in bindings.go
|
|
type Method struct {
|
|
abi.Method
|
|
ID []byte
|
|
}
|
|
|
|
func NewMethod(method abi.Method) (Method, error) {
|
|
if len(method.ID) != 4 {
|
|
return Method{}, errors.New("method ID must be 4 bytes")
|
|
}
|
|
|
|
return Method{
|
|
Method: method,
|
|
ID: method.ID,
|
|
}, nil
|
|
}
|