Skip to content

unmarhsal to nil owner/provider

TheCyberliem requested to merge Marshal_nil_owner_provider into develop

This Pr fix the issue: when get transaction for block and try to get the hash. The hash deprived from transaction and the hash used to get transaction are miss-match.

package main

import (
	"context"
	"fmt"
	"github.com/Evrynetlabs/evrynet-node/common"
	"github.com/Evrynetlabs/evrynet-node/evrclient"
	"log"
)

func main() {
  addr := "http://localhost:22001"
  client, err := evrclient.Dial(addr)
  if err != nil {
    log.Fatal(fmt.Sprintf("failed to dial addr: %v", addr))
  }
   tx, _, _ := client.TransactionByHash(context.Background(),common.HexToHash("0x4f7dc293e39e04e444e863b5ac77a5128c20d35846043302850661b63a3a7b48" +
   	""))
  if tx!= nil {
  	  log.Printf("tx by hash 's hash %s", tx.Hash().Hex())
  }
}

The reason is when get tx from rpc, the field owner and provider is '0x0' instead of null

Merge request reports