@@ -74,7 +74,7 @@ func (s *snapshot) Copy() *snapshot {
7474}
7575
7676// init initializes snapshot with the specified startup parameters.
77- func (s * snapshot ) init (api * ethapi.Backend , h * types.Header , state * state.StateDB , height uint64 ) error {
77+ func (s * snapshot ) init (api ethapi.Backend , h * types.Header , state * state.StateDB , height uint64 ) error {
7878 s .EpochStartHeight = height
7979 round , err := getRoundNumber (api , state , h )
8080 if err != nil {
@@ -603,7 +603,7 @@ watchLoop:
603603 if newWatchList != nil && len (* newWatchList ) > 0 {
604604 watchTaskList = append (watchTaskList , * newWatchList ... )
605605 }
606- currentHeight := ( * c .backend ) .CurrentBlock ().Number .Uint64 ()
606+ currentHeight := c .backend .CurrentBlock ().Number .Uint64 ()
607607 log .Info ("DKG task watcher" , "currentHeight" , currentHeight , "watchListLength" , len (watchTaskList ))
608608
609609 // Loop tasks in watchTaskList.
@@ -806,7 +806,7 @@ func (t *taskList) taskReshareRecover(keystore *antimev.KeyStore, receiverMessag
806806}
807807
808808// getCurrentConsensus returns an address list of current CNs.
809- func getCurrentConsensus (backend * ethapi.Backend , state * state.StateDB , header * types.Header ) ([]common.Address , error ) {
809+ func getCurrentConsensus (backend ethapi.Backend , state * state.StateDB , header * types.Header ) ([]common.Address , error ) {
810810 var result []common.Address
811811 err := readFromContract (& result , backend , systemcontracts .GovernanceProxyHash , systemcontracts .GovernanceABI , state , header , "getCurrentConsensus" )
812812 if err != nil {
@@ -816,7 +816,7 @@ func getCurrentConsensus(backend *ethapi.Backend, state *state.StateDB, header *
816816}
817817
818818// getPendingConsensus returns an address list of pending CNs.
819- func getPendingConsensus (backend * ethapi.Backend , state * state.StateDB , header * types.Header ) ([]common.Address , error ) {
819+ func getPendingConsensus (backend ethapi.Backend , state * state.StateDB , header * types.Header ) ([]common.Address , error ) {
820820 var result []common.Address
821821 err := readFromContract (& result , backend , systemcontracts .GovernanceProxyHash , systemcontracts .GovernanceABI , state , header , "getPendingConsensus" )
822822 if err != nil {
@@ -826,7 +826,7 @@ func getPendingConsensus(backend *ethapi.Backend, state *state.StateDB, header *
826826}
827827
828828// getSharePeriodDuration returns a number of blocks as the duration of each sharing period.
829- func getSharePeriodDuration (backend * ethapi.Backend , state * state.StateDB , header * types.Header ) (uint64 , error ) {
829+ func getSharePeriodDuration (backend ethapi.Backend , state * state.StateDB , header * types.Header ) (uint64 , error ) {
830830 var result * big.Int
831831 err := readFromContract (& result , backend , systemcontracts .GovernanceProxyHash , systemcontracts .GovernanceABI , state , header , "sharePeriodDuration" )
832832 if err != nil {
@@ -836,7 +836,7 @@ func getSharePeriodDuration(backend *ethapi.Backend, state *state.StateDB, heade
836836}
837837
838838// getEpochDuration returns a number of blocks as the duration of each governanace epoch.
839- func getEpochDuration (backend * ethapi.Backend , state * state.StateDB , header * types.Header ) (uint64 , error ) {
839+ func getEpochDuration (backend ethapi.Backend , state * state.StateDB , header * types.Header ) (uint64 , error ) {
840840 var result * big.Int
841841 err := readFromContract (& result , backend , systemcontracts .GovernanceProxyHash , systemcontracts .GovernanceABI , state , header , "epochDuration" )
842842 if err != nil {
@@ -846,7 +846,7 @@ func getEpochDuration(backend *ethapi.Backend, state *state.StateDB, header *typ
846846}
847847
848848// getCurrentEpochStartHeight returns the block height when the current governanace epoch starts.
849- func getCurrentEpochStartHeight (backend * ethapi.Backend , state * state.StateDB , header * types.Header ) (uint64 , error ) {
849+ func getCurrentEpochStartHeight (backend ethapi.Backend , state * state.StateDB , header * types.Header ) (uint64 , error ) {
850850 var result * big.Int
851851 err := readFromContract (& result , backend , systemcontracts .GovernanceProxyHash , systemcontracts .GovernanceABI , state , header , "currentEpochStartHeight" )
852852 if err != nil {
@@ -856,7 +856,7 @@ func getCurrentEpochStartHeight(backend *ethapi.Backend, state *state.StateDB, h
856856}
857857
858858// getMessagePubkeys returns the message keys of input address list.
859- func getMessagePubkeys (backend * ethapi.Backend , addrs []common.Address , state * state.StateDB , header * types.Header ) ([]* ecies.PublicKey , error ) {
859+ func getMessagePubkeys (backend ethapi.Backend , addrs []common.Address , state * state.StateDB , header * types.Header ) ([]* ecies.PublicKey , error ) {
860860 result := make ([]* ecies.PublicKey , len (addrs ))
861861 for i , addr := range addrs {
862862 pub , err := getMessagePubkey (backend , addr , state , header )
@@ -869,7 +869,7 @@ func getMessagePubkeys(backend *ethapi.Backend, addrs []common.Address, state *s
869869}
870870
871871// getMessagePubkey returns the message key of input address.
872- func getMessagePubkey (backend * ethapi.Backend , addr common.Address , state * state.StateDB , header * types.Header ) (* ecies.PublicKey , error ) {
872+ func getMessagePubkey (backend ethapi.Backend , addr common.Address , state * state.StateDB , header * types.Header ) (* ecies.PublicKey , error ) {
873873 var result string
874874 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic , state , header , "messagePubkeys" , addr )
875875 if err != nil {
@@ -887,7 +887,7 @@ func getMessagePubkey(backend *ethapi.Backend, addr common.Address, state *state
887887}
888888
889889// getIndexCurrentNeedRecovering returns an array of DKG index that needs recover.
890- func getIndexCurrentNeedRecovering (backend * ethapi.Backend , state * state.StateDB , header * types.Header ) ([]uint64 , error ) {
890+ func getIndexCurrentNeedRecovering (backend ethapi.Backend , state * state.StateDB , header * types.Header ) ([]uint64 , error ) {
891891 var result []* big.Int
892892 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic , state , header , "indexCurrentNeedRecovering" )
893893 if err != nil {
@@ -901,7 +901,7 @@ func getIndexCurrentNeedRecovering(backend *ethapi.Backend, state *state.StateDB
901901}
902902
903903// isShareReady checks if the DKG sharing is 100% uploaded.
904- func isShareReady (backend * ethapi.Backend , state * state.StateDB , header * types.Header ) (bool , error ) {
904+ func isShareReady (backend ethapi.Backend , state * state.StateDB , header * types.Header ) (bool , error ) {
905905 var result bool
906906 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic , state , header , "isShareReady" )
907907 if err != nil {
@@ -911,7 +911,7 @@ func isShareReady(backend *ethapi.Backend, state *state.StateDB, header *types.H
911911}
912912
913913// getReshareMsgs gets the reshare messages from specific sender index and round.
914- func getReshareMsgs (backend * ethapi.Backend , round , index uint64 , state * state.StateDB , header * types.Header ) ([][]byte , error ) {
914+ func getReshareMsgs (backend ethapi.Backend , round , index uint64 , state * state.StateDB , header * types.Header ) ([][]byte , error ) {
915915 var result [][]byte
916916 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic ,
917917 state , header , "getReshareMsgs" , big .NewInt (int64 (round )), big .NewInt (int64 (index )))
@@ -922,7 +922,7 @@ func getReshareMsgs(backend *ethapi.Backend, round, index uint64, state *state.S
922922}
923923
924924// getResharePVSS gets the reshare PVSS from specific sender index and round.
925- func getResharePVSS (backend * ethapi.Backend , round , index uint64 , state * state.StateDB , header * types.Header ) ([]byte , error ) {
925+ func getResharePVSS (backend ethapi.Backend , round , index uint64 , state * state.StateDB , header * types.Header ) ([]byte , error ) {
926926 var result []byte
927927 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic ,
928928 state , header , "rpvsses" , big .NewInt (int64 (round )), big .NewInt (int64 (index )))
@@ -933,7 +933,7 @@ func getResharePVSS(backend *ethapi.Backend, round, index uint64, state *state.S
933933}
934934
935935// getShareMsgs gets the share messages from specific sender index and round.
936- func getShareMsgs (backend * ethapi.Backend , round , index uint64 , state * state.StateDB , header * types.Header ) ([][]byte , error ) {
936+ func getShareMsgs (backend ethapi.Backend , round , index uint64 , state * state.StateDB , header * types.Header ) ([][]byte , error ) {
937937 var result [][]byte
938938 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic ,
939939 state , header , "getShareMsgs" , big .NewInt (int64 (round )), big .NewInt (int64 (index )))
@@ -944,7 +944,7 @@ func getShareMsgs(backend *ethapi.Backend, round, index uint64, state *state.Sta
944944}
945945
946946// getSharePVSS gets the share PVSS from specific sender index and round.
947- func getSharePVSS (backend * ethapi.Backend , round , index uint64 , state * state.StateDB , header * types.Header ) ([]byte , error ) {
947+ func getSharePVSS (backend ethapi.Backend , round , index uint64 , state * state.StateDB , header * types.Header ) ([]byte , error ) {
948948 var result []byte
949949 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic ,
950950 state , header , "spvsses" , big .NewInt (int64 (round )), big .NewInt (int64 (index )))
@@ -955,7 +955,7 @@ func getSharePVSS(backend *ethapi.Backend, round, index uint64, state *state.Sta
955955}
956956
957957// getRecoverMsgs gets the recover messages from specific sender index and round, with a receiver index.
958- func getRecoverMsgs (backend * ethapi.Backend , round , senderIndex , arrIndex uint64 , state * state.StateDB , header * types.Header ) ([]byte , error ) {
958+ func getRecoverMsgs (backend ethapi.Backend , round , senderIndex , arrIndex uint64 , state * state.StateDB , header * types.Header ) ([]byte , error ) {
959959 var result []byte
960960 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic ,
961961 state , header , "recoverMsgs" , big .NewInt (int64 (round )), big .NewInt (int64 (senderIndex )), big .NewInt (int64 (arrIndex )))
@@ -966,7 +966,7 @@ func getRecoverMsgs(backend *ethapi.Backend, round, senderIndex, arrIndex uint64
966966}
967967
968968// getAggregatedCommitment gets the global aggregated commitment after DKG share.
969- func getAggregatedCommitment (backend * ethapi.Backend , round uint64 , state * state.StateDB , header * types.Header ) ([]byte , error ) {
969+ func getAggregatedCommitment (backend ethapi.Backend , round uint64 , state * state.StateDB , header * types.Header ) ([]byte , error ) {
970970 var result []byte
971971 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic ,
972972 state , header , "aggregatedCommitments" , big .NewInt (int64 (round )))
@@ -977,7 +977,7 @@ func getAggregatedCommitment(backend *ethapi.Backend, round uint64, state *state
977977}
978978
979979// getRoundNumber gets the DKG round number.
980- func getRoundNumber (backend * ethapi.Backend , state * state.StateDB , header * types.Header ) (uint64 , error ) {
980+ func getRoundNumber (backend ethapi.Backend , state * state.StateDB , header * types.Header ) (uint64 , error ) {
981981 var result * big.Int
982982 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic ,
983983 state , header , "roundNumber" )
@@ -988,7 +988,7 @@ func getRoundNumber(backend *ethapi.Backend, state *state.StateDB, header *types
988988}
989989
990990// getZKVersion gets the DKG ZK version
991- func getZKVersion (backend * ethapi.Backend , state * state.StateDB , header * types.Header ) (uint64 , error ) {
991+ func getZKVersion (backend ethapi.Backend , state * state.StateDB , header * types.Header ) (uint64 , error ) {
992992 var result * big.Int
993993 err := readFromContract (& result , backend , systemcontracts .KeyManagementProxyHash , systemcontracts .KeyManagementABIBasic ,
994994 state , header , "ZK_VERSION" )
@@ -999,7 +999,7 @@ func getZKVersion(backend *ethapi.Backend, state *state.StateDB, header *types.H
999999}
10001000
10011001// readFromContract calls a contract with ABI-packed inputs.
1002- func readFromContract (res interface {}, backend * ethapi.Backend , contract common.Address , contractAbi abi.ABI , state * state.StateDB , header * types.Header , method string , args ... interface {}) error {
1002+ func readFromContract (res interface {}, backend ethapi.Backend , contract common.Address , contractAbi abi.ABI , state * state.StateDB , header * types.Header , method string , args ... interface {}) error {
10031003 if backend == nil {
10041004 return errNotInitializedBackend
10051005 }
@@ -1018,7 +1018,7 @@ func readFromContract(res interface{}, backend *ethapi.Backend, contract common.
10181018 ctx , cancel := context .WithCancel (context .Background ())
10191019 // Cancel when we are finished consuming integers.
10201020 defer cancel ()
1021- result , err := ethapi .DoCallAtState (ctx , * backend , txArgs , state , header , nil , nil , 0 , 0 )
1021+ result , err := ethapi .DoCallAtState (ctx , backend , txArgs , state , header , nil , nil , 0 , 0 )
10221022 if err != nil {
10231023 return fmt .Errorf ("failed to call at state '%s': %v" , method , err )
10241024 }
0 commit comments