From 589d5747b62c5e79e75cdb1009f725e64ba58acc Mon Sep 17 00:00:00 2001 From: Trajan0x Date: Wed, 25 Oct 2023 14:17:43 +0100 Subject: [PATCH] sinner strings for contract_type --- services/sinner/config/indexer/config.go | 12 ++++++------ .../sinner/config/indexer/contracttype_string.go | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/services/sinner/config/indexer/config.go b/services/sinner/config/indexer/config.go index c19603a203..d4883afb92 100644 --- a/services/sinner/config/indexer/config.go +++ b/services/sinner/config/indexer/config.go @@ -15,24 +15,24 @@ import ( // ContractType is the type of contract specified by the config and used for selecting the correct parser. // -//go:generate go run golang.org/x/tools/cmd/stringer -type=ContractType +//go:generate go run golang.org/x/tools/cmd/stringer -type=ContractType -linecomment type ContractType int const ( // OriginType is the ContractType for the origin contract. - OriginType ContractType = iota + OriginType ContractType = iota // origin // ExecutionHubType is the ContractType for the execution hub contract. - ExecutionHubType + ExecutionHubType // execution_hub // UnknownType is the ContractType for an unknown contract. - UnknownType + UnknownType // unknown ) // ContractTypeFromString converts a string (intended to be from parsed config) into the ContractType type. func ContractTypeFromString(s string) (ContractType, error) { switch s { - case "origin": + case OriginType.String(): return OriginType, nil - case "execution_hub": + case ExecutionHubType.String(): return ExecutionHubType, nil default: return UnknownType, fmt.Errorf("unknown contract type: %s", s) diff --git a/services/sinner/config/indexer/contracttype_string.go b/services/sinner/config/indexer/contracttype_string.go index c2bbd0620f..a2dc62a910 100644 --- a/services/sinner/config/indexer/contracttype_string.go +++ b/services/sinner/config/indexer/contracttype_string.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -type=ContractType"; DO NOT EDIT. +// Code generated by "stringer -type=ContractType -linecomment"; DO NOT EDIT. package indexerconfig @@ -13,9 +13,9 @@ func _() { _ = x[UnknownType-2] } -const _ContractType_name = "OriginTypeExecutionHubTypeUnknownType" +const _ContractType_name = "originexecution_hubunknown" -var _ContractType_index = [...]uint8{0, 10, 26, 37} +var _ContractType_index = [...]uint8{0, 6, 19, 26} func (i ContractType) String() string { if i < 0 || i >= ContractType(len(_ContractType_index)-1) {