mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-24 13:46:43 +00:00
fix(ccc): fix CCC build errors (#506)
This commit is contained in:
parent
7d79f27e6f
commit
1d824f42bd
2 changed files with 7 additions and 8 deletions
|
|
@ -24,7 +24,7 @@ import (
|
||||||
const (
|
const (
|
||||||
VersionMajor = 4 // Major version component of the current release
|
VersionMajor = 4 // Major version component of the current release
|
||||||
VersionMinor = 4 // Minor version component of the current release
|
VersionMinor = 4 // Minor version component of the current release
|
||||||
VersionPatch = 3 // Patch version component of the current release
|
VersionPatch = 4 // Patch version component of the current release
|
||||||
VersionMeta = "sepolia" // Version metadata to append to the version string
|
VersionMeta = "sepolia" // Version metadata to append to the version string
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import "C" //nolint:typecheck
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"sync"
|
"sync"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
|
||||||
|
|
@ -147,7 +148,7 @@ func (ccc *CircuitCapacityChecker) ApplyBlock(traces *types.BlockTrace) (*types.
|
||||||
}
|
}
|
||||||
|
|
||||||
// CheckTxNum compares whether the tx_count in ccc match the expected
|
// CheckTxNum compares whether the tx_count in ccc match the expected
|
||||||
func (ccc *CircuitCapacityChecker) CheckTxNum(expected int) (bool, unit64, error) {
|
func (ccc *CircuitCapacityChecker) CheckTxNum(expected int) (bool, uint64, error) {
|
||||||
ccc.Lock()
|
ccc.Lock()
|
||||||
defer ccc.Unlock()
|
defer ccc.Unlock()
|
||||||
|
|
||||||
|
|
@ -159,14 +160,12 @@ func (ccc *CircuitCapacityChecker) CheckTxNum(expected int) (bool, unit64, error
|
||||||
log.Debug("ccc get_tx_num end", "id", ccc.ID)
|
log.Debug("ccc get_tx_num end", "id", ccc.ID)
|
||||||
|
|
||||||
result := &WrappedTxNum{}
|
result := &WrappedTxNum{}
|
||||||
if err = json.Unmarshal([]byte(C.GoString(rawResult)), result); err != nil {
|
if err := json.Unmarshal([]byte(C.GoString(rawResult)), result); err != nil {
|
||||||
log.Error("fail to json unmarshal get_tx_num result", "id", ccc.ID, "err", err)
|
return false, 0, fmt.Errorf("fail to json unmarshal get_tx_num result, id: %d, err: %w", ccc.ID, err)
|
||||||
return false, 0, ErrUnknown
|
|
||||||
}
|
}
|
||||||
if result.Error != "" {
|
if result.Error != "" {
|
||||||
log.Error("fail to get_tx_num in CircuitCapacityChecker", "id", ccc.ID, "err", result.Error)
|
return false, 0, fmt.Errorf("fail to get_tx_num in CircuitCapacityChecker, id: %d, err: %w", ccc.ID, result.Error)
|
||||||
return false, 0, ErrUnknown
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.TxNum == unit64(expected), result.TxNum, nil
|
return result.TxNum == uint64(expected), result.TxNum, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue