Skip to content

Commit

Permalink
Fix emptychronicle response decode (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Atralupus authored Mar 15, 2024
1 parent 4a576ab commit bd34fa0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions NineChroniclesUtilBackend/Repositories/CpRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ private async Task<T> GetState<T>(Address address, string? account = null)
var codec = new Codec();
var url =
account == null
? $"${emptyChronicleEndpoint}/api/states/{address}/raw"
: $"${emptyChronicleEndpoint}/api/states/{address}/raw?account={account}";
? $"{emptyChronicleEndpoint.AbsoluteUri}api/states/{address}/raw"
: $"{emptyChronicleEndpoint.AbsoluteUri}api/states/{address}/raw?account={account}";
var client = new HttpClient();
var response = await client.GetAsync(url);
var json = JsonNode.Parse(await response.Content.ReadAsStringAsync());
Expand All @@ -141,7 +141,7 @@ private async Task<T> GetState<T>(Address address, string? account = null)
{
throw new NullReferenceException();
}
var value = codec.Decode(Convert.FromBase64String(rawValue));
var value = codec.Decode(Convert.FromHexString(rawValue));

return (T)value;
}
Expand Down

0 comments on commit bd34fa0

Please sign in to comment.