From d0c158b01921a636ce616a1baa5fcd9bfe54b554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Mon, 17 Feb 2020 19:20:38 +0100 Subject: [PATCH] genesis: Handle CreateMiner return correctly --- chain/gen/genesis/miners.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go index 19a76c931..4cc1a92ab 100644 --- a/chain/gen/genesis/miners.go +++ b/chain/gen/genesis/miners.go @@ -58,16 +58,16 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid return cid.Undef, xerrors.Errorf("failed to create genesis miner: %w", err) } - maddrret, err := address.NewFromBytes(rval) - if err != nil { + var ma power.CreateMinerReturn + if err := ma.UnmarshalCBOR(bytes.NewReader(rval)); err != nil { return cid.Undef, err } expma := MinerAddress(uint64(i)) - if maddrret != expma { - return cid.Undef, xerrors.Errorf("miner assigned wrong address: %s != %s", maddrret, expma) + if ma.IDAddress != expma { + return cid.Undef, xerrors.Errorf("miner assigned wrong address: %s != %s", ma.IDAddress, expma) } - maddr = maddrret + maddr = ma.IDAddress } // Add market funds