Use rpc.ContractDelegate() to fetch the delegate address of a delegator, or baker (to check if baker is registered to bake). In the case of no baker set, or not registered to bake, the RPC context/contracts/%s/delegate returns 404. The JSON Unmarshal attempts to unmarshal a non-existent response body which fails as error.
This is a false-negative and the function overall should succeed and return "" when no delegate is set.
Use rpc.ContractDelegate() to fetch the delegate address of a delegator, or baker (to check if baker is registered to bake). In the case of no baker set, or not registered to bake, the RPC
context/contracts/%s/delegate
returns 404. The JSON Unmarshal attempts to unmarshal a non-existent response body which fails as error.This is a false-negative and the function overall should succeed and return
""
when no delegate is set.