ipld-eth-state-snapshot/pkg/snapshot/mock/util.go
Roy Crihfield 159f93902e tests - mock publisher with fixtures
* go structs for header, etc.
* refactor: pkg/types

* add fixture chaindata
2022-01-14 21:43:00 -06:00

24 lines
440 B
Go

package mock
import "fmt"
import "github.com/golang/mock/gomock"
type anyOfMatcher struct {
values []interface{}
}
func (m anyOfMatcher) Matches(x interface{}) bool {
for _, v := range m.values {
if gomock.Eq(v).Matches(x) {
return true
}
}
return false
}
func (m anyOfMatcher) String() string {
return fmt.Sprintf("is equal to any of %+v", m.values)
}
func AnyOf(xs ...interface{}) anyOfMatcher {
return anyOfMatcher{xs}
}