Skip to content

Commit 77c8deb

Browse files
author
boaz
committed
feat: update logic for merding hinters
1 parent 1749630 commit 77c8deb

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

cmds/hinters.go

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"github.com/ProtoconNet/mitum-timestamp/operation/timestamp"
66
"github.com/ProtoconNet/mitum-timestamp/state"
77
"github.com/ProtoconNet/mitum-timestamp/types"
8-
"github.com/ProtoconNet/mitum2/launch"
98
"github.com/ProtoconNet/mitum2/util/encoder"
109
"github.com/pkg/errors"
1110
)
@@ -33,25 +32,11 @@ var AddedSupportedHinters = []encoder.DecodeDetail{
3332
}
3433

3534
func init() {
36-
defaultLen := len(launch.Hinters)
37-
currencyExtendedLen := defaultLen + len(currencycmds.AddedHinters)
38-
allExtendedLen := currencyExtendedLen + len(AddedHinters)
35+
Hinters = append(Hinters, currencycmds.Hinters...)
36+
Hinters = append(Hinters, AddedHinters...)
3937

40-
Hinters = make([]encoder.DecodeDetail, allExtendedLen)
41-
copy(Hinters, launch.Hinters)
42-
copy(Hinters[defaultLen:currencyExtendedLen], currencycmds.AddedHinters)
43-
copy(Hinters[currencyExtendedLen:], AddedHinters)
44-
45-
defaultSupportedLen := len(launch.SupportedProposalOperationFactHinters)
46-
currencySupportedExtendedLen := defaultSupportedLen + len(currencycmds.AddedSupportedHinters)
47-
allSupportedExtendedLen := currencySupportedExtendedLen + len(AddedSupportedHinters)
48-
49-
SupportedProposalOperationFactHinters = make(
50-
[]encoder.DecodeDetail,
51-
allSupportedExtendedLen)
52-
copy(SupportedProposalOperationFactHinters, launch.SupportedProposalOperationFactHinters)
53-
copy(SupportedProposalOperationFactHinters[defaultSupportedLen:currencySupportedExtendedLen], currencycmds.AddedSupportedHinters)
54-
copy(SupportedProposalOperationFactHinters[currencySupportedExtendedLen:], AddedSupportedHinters)
38+
SupportedProposalOperationFactHinters = append(SupportedProposalOperationFactHinters, currencycmds.SupportedProposalOperationFactHinters...)
39+
SupportedProposalOperationFactHinters = append(SupportedProposalOperationFactHinters, AddedSupportedHinters...)
5540
}
5641

5742
func LoadHinters(encs *encoder.Encoders) error {

0 commit comments

Comments
 (0)