Skip to content

Commit

Permalink
Merge branch 'master' into effective-stake
Browse files Browse the repository at this point in the history
  • Loading branch information
jclapis committed May 26, 2021
2 parents 38d1336 + 6e72501 commit f5df68c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"math/big"
"sync"
"time"

"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -300,6 +301,10 @@ func EstimateSetTimezoneLocationGas(rp *rocketpool.RocketPool, timezoneLocation
if err != nil {
return rocketpool.GasInfo{}, err
}
_, err = time.LoadLocation(timezoneLocation)
if err != nil {
return rocketpool.GasInfo{}, fmt.Errorf("Could not parse timezone [%s]: %w", timezoneLocation, err)
}
return rocketNodeManager.GetTransactionGasInfo(opts, "setTimezoneLocation", timezoneLocation)
}

Expand All @@ -310,6 +315,10 @@ func SetTimezoneLocation(rp *rocketpool.RocketPool, timezoneLocation string, opt
if err != nil {
return common.Hash{}, err
}
_, err = time.LoadLocation(timezoneLocation)
if err != nil {
return common.Hash{}, fmt.Errorf("Could not parse timezone [%s]: %w", timezoneLocation, err)
}
hash, err := rocketNodeManager.Transact(opts, "setTimezoneLocation", timezoneLocation)
if err != nil {
return common.Hash{}, fmt.Errorf("Could not set node timezone location: %w", err)
Expand Down

0 comments on commit f5df68c

Please sign in to comment.