From c410219cba5f6df8b875f0edeb3e332c8ce9bb2d Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Fri, 6 May 2022 10:08:09 +0300 Subject: [PATCH] transaction: fix Rules stringer, it's WitnessRules in C# See neo-project/neo#2720. --- pkg/core/transaction/witness_scope.go | 4 ++-- pkg/core/transaction/witness_scope_string.go | 4 ++-- pkg/network/message_string.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/core/transaction/witness_scope.go b/pkg/core/transaction/witness_scope.go index 8950290cd..f4d75157e 100644 --- a/pkg/core/transaction/witness_scope.go +++ b/pkg/core/transaction/witness_scope.go @@ -1,6 +1,6 @@ package transaction -//go:generate stringer -type=WitnessScope -output=witness_scope_string.go +//go:generate stringer -type=WitnessScope -linecomment -output=witness_scope_string.go import ( "encoding/json" "fmt" @@ -23,7 +23,7 @@ const ( // CustomGroups define custom pubkey for group members. CustomGroups WitnessScope = 0x20 // Rules is a set of conditions with boolean operators. - Rules WitnessScope = 0x40 + Rules WitnessScope = 0x40 // WitnessRules // Global allows this witness in all contexts (default Neo2 behavior). // This cannot be combined with other flags. Global WitnessScope = 0x80 diff --git a/pkg/core/transaction/witness_scope_string.go b/pkg/core/transaction/witness_scope_string.go index 5f6666af1..805ac1473 100644 --- a/pkg/core/transaction/witness_scope_string.go +++ b/pkg/core/transaction/witness_scope_string.go @@ -1,4 +1,4 @@ -// Code generated by "stringer -type=WitnessScope -output=witness_scope_string.go"; DO NOT EDIT. +// Code generated by "stringer -type=WitnessScope -linecomment -output=witness_scope_string.go"; DO NOT EDIT. package transaction @@ -20,7 +20,7 @@ const ( _WitnessScope_name_0 = "NoneCalledByEntry" _WitnessScope_name_1 = "CustomContracts" _WitnessScope_name_2 = "CustomGroups" - _WitnessScope_name_3 = "Rules" + _WitnessScope_name_3 = "WitnessRules" _WitnessScope_name_4 = "Global" ) diff --git a/pkg/network/message_string.go b/pkg/network/message_string.go index 2ebdacd9b..8e516f377 100644 --- a/pkg/network/message_string.go +++ b/pkg/network/message_string.go @@ -62,7 +62,7 @@ var ( func (i CommandType) String() string { switch { - case i <= 1: + case 0 <= i && i <= 1: return _CommandType_name_0[_CommandType_index_0[i]:_CommandType_index_0[i+1]] case 16 <= i && i <= 17: i -= 16