Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions bindings/legacy/v1.1.0-rc1/rewards/rewards.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ func GetRewardSnapshotEvent(rp *rocketpool.RocketPool, index uint64, intervalSiz
}

// Get the decoded data
submissionPrototype := RewardSubmission{}
submissionType := reflect.TypeOf(submissionPrototype)
submissionType := reflect.TypeFor[RewardSubmission]()
submission := reflect.ValueOf(values["submission"]).Convert(submissionType).Interface().(RewardSubmission)
eventIntervalStartTime := values["intervalStartTime"].(*big.Int)
eventIntervalEndTime := values["intervalEndTime"].(*big.Int)
Expand Down Expand Up @@ -266,8 +265,7 @@ func GetRewardSnapshotEventWithUpgrades(rp *rocketpool.RocketPool, index uint64,
}

// Get the decoded data
submissionPrototype := RewardSubmission{}
submissionType := reflect.TypeOf(submissionPrototype)
submissionType := reflect.TypeFor[RewardSubmission]()
submission := reflect.ValueOf(values["submission"]).Convert(submissionType).Interface().(RewardSubmission)
eventIntervalStartTime := values["intervalStartTime"].(*big.Int)
eventIntervalEndTime := values["intervalEndTime"].(*big.Int)
Expand Down
4 changes: 2 additions & 2 deletions shared/services/config/rocket-pool-config.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,8 @@ func (cfg *RocketPoolConfig) Deserialize(masterMap map[string]map[string]string)
if exists {
networkString, exists := smartnodeConfig[cfg.Smartnode.Network.ID]
if exists {
valueType := reflect.TypeOf(networkString)
paramType := reflect.TypeOf(network)
valueType := reflect.TypeFor[string]()
paramType := reflect.TypeFor[config.Network]()
if !valueType.ConvertibleTo(paramType) {
return fmt.Errorf("can't get default network: value type %s cannot be converted to parameter type %s", valueType.Name(), paramType.Name())
}
Expand Down
2 changes: 1 addition & 1 deletion shared/types/config/parameter.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (param *Parameter) Deserialize(serializedParams map[string]string, network
if len(param.Options) < 1 {
err = fmt.Errorf("this parameter is marked as a choice but does not have any options")
} else {
valueType := reflect.TypeOf(value)
valueType := reflect.TypeFor[string]()
paramType := reflect.TypeOf(param.Options[0].Value)
if !valueType.ConvertibleTo(paramType) {
err = fmt.Errorf("value type %s cannot be converted to parameter type %s", valueType.Name(), paramType.Name())
Expand Down
2 changes: 1 addition & 1 deletion shared/types/eth2/fork/deneb/state_deneb.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func getStateChunkSize() uint64 {
// Use a static value to avoid multiple reflection calls
storedChunkSize := beaconStateChunkSize.Load()
if storedChunkSize == 0 {
s := reflect.TypeOf(BeaconState{}).NumField()
s := reflect.TypeFor[BeaconState]().NumField()
beaconStateChunkSize.Store(uint64(s))
storedChunkSize = uint64(s)
}
Expand Down
2 changes: 1 addition & 1 deletion shared/types/eth2/fork/electra/state_electra.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func getStateChunkSize() uint64 {
// Use a static value to avoid multiple reflection calls
storedChunkSize := beaconStateChunkSize.Load()
if storedChunkSize == 0 {
s := reflect.TypeOf(BeaconState{}).NumField()
s := reflect.TypeFor[BeaconState]().NumField()
beaconStateChunkSize.Store(uint64(s))
storedChunkSize = uint64(s)
}
Expand Down
2 changes: 1 addition & 1 deletion shared/types/eth2/fork/fulu/state_fulu.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func getStateChunkSize() uint64 {
// Use a static value to avoid multiple reflection calls
storedChunkSize := beaconStateChunkSize.Load()
if storedChunkSize == 0 {
s := reflect.TypeOf(BeaconState{}).NumField()
s := reflect.TypeFor[BeaconState]().NumField()
beaconStateChunkSize.Store(uint64(s))
storedChunkSize = uint64(s)
}
Expand Down
Loading