Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
miiu96 committed Nov 15, 2023
1 parent 91e9d6c commit baf024b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions node/chainSimulator/configs/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ var initialSupply = big.NewInt(0).Mul(oneEgld, big.NewInt(20000000)) // 20 milli
const (
// ChainID contains the chain id
ChainID = "chain"

shardIDWalletWithStake = 0
)

// ArgsChainSimulatorConfigs holds all the components needed to create the chain simulator configs
Expand Down Expand Up @@ -125,7 +127,7 @@ func generateGenesisFile(args ArgsChainSimulatorConfigs, configs *config.Configs
ShardWallets: make(map[uint32]*dtos.WalletKey),
}

initialAddressWithStake, err := generateWalletKeyForShard(0, args.NumOfShards, addressConverter)
initialAddressWithStake, err := generateWalletKeyForShard(shardIDWalletWithStake, args.NumOfShards, addressConverter)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -158,20 +160,18 @@ func generateGenesisFile(args ArgsChainSimulatorConfigs, configs *config.Configs
return nil, errG
}

balanceForAddress := big.NewInt(0).Set(walletBalance)
if shardID == args.NumOfShards-1 {
balanceForAddress.Add(balanceForAddress, remainder)
}

addresses = append(addresses, data.InitialAccount{
Address: walletKey.Address,
Balance: balanceForAddress,
Supply: balanceForAddress,
Balance: big.NewInt(0).Set(walletBalance),
Supply: big.NewInt(0).Set(walletBalance),
})

initialWalletKeys.ShardWallets[shardID] = walletKey
}

addresses[1].Balance.Add(walletBalance, remainder)
addresses[1].Supply.Add(walletBalance, remainder)

addressesBytes, errM := json.Marshal(addresses)
if errM != nil {
return nil, errM
Expand Down

0 comments on commit baf024b

Please sign in to comment.