From 277c03767681762559a06fc6dad9fa1af0a4c971 Mon Sep 17 00:00:00 2001 From: Travis Person Date: Fri, 6 Mar 2020 08:08:07 +0000 Subject: [PATCH] fountain: decode create miner results correctly --- cmd/lotus-fountain/main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmd/lotus-fountain/main.go b/cmd/lotus-fountain/main.go index d6c9085de..382e55d59 100644 --- a/cmd/lotus-fountain/main.go +++ b/cmd/lotus-fountain/main.go @@ -1,6 +1,7 @@ package main import ( + "bytes" "context" "fmt" "net" @@ -345,12 +346,13 @@ func (h *handler) msgwaitaddr(w http.ResponseWriter, r *http.Request) { } w.WriteHeader(200) - addr, err := address.NewFromBytes(mw.Receipt.Return) - if err != nil { + var ma power.CreateMinerReturn + if err := ma.UnmarshalCBOR(bytes.NewReader(mw.Receipt.Return)); err != nil { + log.Errorf("%w", err) w.WriteHeader(400) w.Write([]byte(err.Error())) return } - fmt.Fprintf(w, "{\"addr\": \"%s\"}", addr) + fmt.Fprintf(w, "{\"addr\": \"%s\"}", ma.IDAddress) }