rename attoFil -> filToAttoFil

This commit is contained in:
Yusef Napora 2020-07-08 10:25:50 -04:00
parent 4926a788c1
commit 4227f2d9dc

View File

@ -58,7 +58,7 @@ func PrepareBootstrapper(t *TestEnvironment) (*Bootstrapper, error) {
totalBalance := big.Zero() totalBalance := big.Zero()
for _, b := range balances { for _, b := range balances {
totalBalance = big.Add(attoFil(b.Balance), totalBalance) totalBalance = big.Add(filToAttoFil(b.Balance), totalBalance)
} }
totalBalanceFil := attoFilToFil(totalBalance) totalBalanceFil := attoFilToFil(totalBalance)
@ -78,7 +78,7 @@ func PrepareBootstrapper(t *TestEnvironment) (*Bootstrapper, error) {
var genesisMiners []genesis.Miner var genesisMiners []genesis.Miner
for _, bm := range balances { for _, bm := range balances {
balance := attoFil(bm.Balance) balance := filToAttoFil(bm.Balance)
t.RecordMessage("balance assigned to actor %s: %s AttoFIL", bm.Addr, balance) t.RecordMessage("balance assigned to actor %s: %s AttoFIL", bm.Addr, balance)
genesisActors = append(genesisActors, genesisActors = append(genesisActors,
genesis.Actor{ genesis.Actor{
@ -181,8 +181,8 @@ func (b *Bootstrapper) RunDefault() error {
return nil return nil
} }
// attoFil converts a fractional filecoin value into AttoFIL, rounding if necessary // filToAttoFil converts a fractional filecoin value into AttoFIL, rounding if necessary
func attoFil(f float64) big.Int { func filToAttoFil(f float64) big.Int {
a := mbig.NewFloat(f) a := mbig.NewFloat(f)
a.Mul(a, mbig.NewFloat(float64(build.FilecoinPrecision))) a.Mul(a, mbig.NewFloat(float64(build.FilecoinPrecision)))
i, _ := a.Int(nil) i, _ := a.Int(nil)