[clean] fix goimports errors

Signed-off-by: Leo Chen <leo@harmony.one>
pull/985/head
Leo Chen 6 years ago
parent d4bc460a80
commit 4d1c461765
  1. 2
      api/service/staking/service.go
  2. 2
      cmd/client/txgen/main.go
  3. 3
      consensus/consensus.go
  4. 2
      core/resharding.go
  5. 37
      internal/genesis/genesis.go
  6. 2
      internal/genesis/newnodes.go
  7. 2
      node/contract.go
  8. 2
      node/node_genesis.go

@ -24,9 +24,9 @@ import (
"github.com/harmony-one/harmony/core"
"github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/internal/ctxerror"
"github.com/harmony-one/harmony/internal/genesis"
hmykey "github.com/harmony-one/harmony/internal/keystore"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/internal/genesis"
"github.com/harmony-one/harmony/p2p"
"github.com/harmony-one/harmony/p2p/host"
)

@ -27,8 +27,8 @@ import (
"github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/crypto/bls"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/internal/genesis"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/node"
"github.com/harmony-one/harmony/p2p"
p2p_host "github.com/harmony-one/harmony/p2p/host"

@ -17,8 +17,9 @@ import (
bls_cosi "github.com/harmony-one/harmony/crypto/bls"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/internal/ctxerror"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/internal/genesis"
"github.com/harmony-one/harmony/internal/memprofiling"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/p2p"
)

@ -237,7 +237,7 @@ func GetInitShardState() types.ShardState {
// add FN runner's key
for j := GenesisShardHarmony; j < GenesisShardSize; j++ {
index := i + (j - GenesisShardHarmony)*GenesisShardNum
index := i + (j-GenesisShardHarmony)*GenesisShardNum
priKey := bls.SecretKey{}
priKey.SetHexString(genesis.GenesisFNAccounts[index].BLSKey)
pubKey := types.BlsPublicKey{}

@ -2,7 +2,7 @@ package genesis
import (
"crypto/ecdsa"
"fmt"
"fmt"
"os"
"strings"
@ -10,19 +10,18 @@ import (
"github.com/harmony-one/harmony/internal/utils"
)
const genesisString = "https://harmony.one 'Open Consensus for 10B' 2019.06.01 $ONE"
// DeployAccount is the account used in genesis
type DeployAccount struct {
Address string // account address
Public string // account public key
BLSKey string // account private BLS key (To be removed)
ShardID uint32 // shardID of the account
Address string // account address
Public string // account public key
BLSKey string // account private BLS key (To be removed)
ShardID uint32 // shardID of the account
}
func (d DeployAccount) String() string {
return fmt.Sprintf("%s/%s/%s:%d", d.Address, d.Public, d.BLSKey, d.ShardID)
return fmt.Sprintf("%s/%s/%s:%d", d.Address, d.Public, d.BLSKey, d.ShardID)
}
// BeaconAccountPriKey is the func which generates a constant private key.
@ -39,17 +38,17 @@ func BeaconAccountPriKey() *ecdsa.PrivateKey {
// the account address could be from GenesisAccounts or from GenesisFNAccounts
// the account index can be used to determin the shard of the account
func FindAccount(address string) (int, *DeployAccount) {
for i, acc := range GenesisAccounts {
if address == acc.Address {
return i, &acc
}
}
for i, acc := range GenesisFNAccounts {
if address == acc.Address {
return i, &acc
}
}
return 0, nil
for i, acc := range GenesisAccounts {
if address == acc.Address {
return i, &acc
}
}
for i, acc := range GenesisFNAccounts {
if address == acc.Address {
return i, &acc
}
}
return 0, nil
}
// GenesisBeaconAccountPriKey is the private key of genesis beacon account.
@ -63,7 +62,7 @@ var DeployedContractAddress = crypto.CreateAddress(crypto.PubkeyToAddress(Genesi
// GenesisAccounts are the accounts for the initial genesis nodes hosted by Harmony.
var GenesisAccounts = [...]DeployAccount{
// 0-9
// 0-9
{Address: "0x007579ED2Fe889C5255C36d4978Ac94d25811771", Public: "0x007579ED2Fe889C5255C36d4978Ac94d25811771", BLSKey: "66acb3a7c990be4b06709058fdef8122b7ecdbaf023e56ccf8cdf671c5333646"},
{Address: "0x00F98965458a35f3788C45A095582AB18A5ae79c", Public: "0x00F98965458a35f3788C45A095582AB18A5ae79c", BLSKey: "5e9e2fffbf7cfad085d7b0147d2acd680cfd8b8d62daa9c39370185ba0207920"},
{Address: "0x0102B41674C3ac2634f404d8c25C25Bb959fE952", Public: "0x0102B41674C3ac2634f404d8c25C25Bb959fE952", BLSKey: "56714bb94188c335d1243fa3d17fd50ff63a1a9bf740faecd97996f3a0737e87"},

@ -1,7 +1,7 @@
package genesis
// NewNodeAccounts are the accounts for the new node
var NewNodeAccounts = [...]DeployAccount {
var NewNodeAccounts = [...]DeployAccount{
{Address: "0x0e59b767D5E74cf7B29Ef9bEc3dA4c402d357C6C", Public: "0x0e59b767D5E74cf7B29Ef9bEc3dA4c402d357C6C", BLSKey: "60c398270c8122ae196f03b9bee10186f224f0fe378eefbdcdfd2240a52d46ef"},
{Address: "0x0fAAda81c203C74CAc786786f7D428477a04bF9c", Public: "0x0fAAda81c203C74CAc786786f7D428477a04bF9c", BLSKey: "3ff0efdc6c88d21070721840da44cb2d381a6056d08bc2bc5552bfaafd3652b3"},
{Address: "0x0fd228bdFbe9ad0c898e9A0Fee2E6FB01f596F0d", Public: "0x0fd228bdFbe9ad0c898e9A0Fee2E6FB01f596F0d", BLSKey: "34ef1d0db507afd5b59aa52c73cf2a46e25026a36592d83e561e07d618a10b4e"},

@ -16,8 +16,8 @@ import (
"github.com/harmony-one/harmony/contracts"
"github.com/harmony-one/harmony/contracts/structs"
"github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/internal/genesis"
"github.com/harmony-one/harmony/internal/utils"
)
// Constants related to smart contract.

@ -17,8 +17,8 @@ import (
"github.com/harmony-one/harmony/core/rawdb"
"github.com/harmony-one/harmony/core/types"
"github.com/harmony-one/harmony/internal/ctxerror"
"github.com/harmony-one/harmony/internal/utils"
"github.com/harmony-one/harmony/internal/genesis"
"github.com/harmony-one/harmony/internal/utils"
)
const (

Loading…
Cancel
Save