goat-systems / go-tezos

Go Tezos Is a Go library that exposes and builds upon the Tezos RPC.
MIT License
71 stars 45 forks source link

Cannot use BlockIDHash for fetching rights #179

Open utdrmac opened 3 years ago

utdrmac commented 3 years ago
bakingRightsFilter := rpc.BakingRightsInput{
    BlockID:     rpc.BlockIDHash("BLzGD63HA4RP8Fh5xEtvdQSMKa2WzJMZjQPNVUc4Rqy8Lh5BEY1"),
    Level:       nextLevelToBake,
    Delegate:    (*bakerPkh),
    MaxPriority: maxBakePriority,
}

cannot use rpc.BlockIDHash("BLzGD63HA4RP8Fh5xEtvdQSMKa2WzJMZjQPNVUc4Rqy8Lh5BEY1") (type rpc.BlockIDHash) as type rpc.BlockID in field value: rpc.BlockIDHash does not implement rpc.BlockID (ID method has pointer receiver)

utdrmac commented 3 years ago

Umm... what?

var h rpc.BlockIDHash = block.Hash

./baking.go:83:6: cannot use block.Hash (type string) as type rpc.BlockIDHash in assignment

Yet this works: var h rpc.BlockIDHash = "BLzGD63HA4RP8Fh5xEtvdQSMKa2WzJMZjQPNVUc4Rqy8Lh5BEY1"

Both strings, why doesn't the above work?