Fix lint warnings

License: MIT
Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
This commit is contained in:
Jakub Sztandera 2019-07-12 17:06:16 +02:00
parent c4022505c7
commit 44fdf98484
2 changed files with 9 additions and 3 deletions

View File

@ -89,7 +89,7 @@ func (ia InitActor) Exec(act *types.Actor, vmctx types.VMContext, p *ExecParams)
}
// The call to the actors constructor will set up the initial state
// from the given parameters, setting `actor.Head` to a new value when successfull.
// from the given parameters, setting `actor.Head` to a new value when successful.
// TODO: can constructors fail?
//actor.Constructor(p.Params)

View File

@ -258,9 +258,15 @@ func (vm *VM) Invoke(act *types.Actor, vmctx *VMContext, method uint64, params [
func ComputeActorAddress(creator address.Address, nonce uint64) (address.Address, error) {
buf := new(bytes.Buffer)
buf.Write(creator.Bytes())
_, err := buf.Write(creator.Bytes())
if err != nil {
return address.Address{}, err
}
binary.Write(buf, binary.BigEndian, nonce)
err = binary.Write(buf, binary.BigEndian, nonce)
if err != nil {
return address.Address{}, err
}
return address.NewActorAddress(buf.Bytes())
}