From ffe591678ab3de157f46e2c26236ab544d6fc3df Mon Sep 17 00:00:00 2001 From: Howard Date: Tue, 26 Mar 2024 14:41:26 -0700 Subject: [PATCH] Display correct ContractResolver address (#4) --- SharedService/Resolver.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/SharedService/Resolver.cs b/SharedService/Resolver.cs index f9b70cf..3717469 100644 --- a/SharedService/Resolver.cs +++ b/SharedService/Resolver.cs @@ -31,7 +31,6 @@ public enum ContractType { Allowlist , BackupRecovery, - ContractResolver, DomainWalletOracle, DomainWalletRegistry, HDKeyDeriver, @@ -104,8 +103,6 @@ public static byte[] GetContractTypKeccak(ContractType contractType) { case ContractType.BackupRecovery: typ = keccak256("BACKUP_RECOVERY"); break; - case ContractType.ContractResolver: - break; case ContractType.DomainWalletOracle: typ = keccak256("DOMAIN_WALLET_ORACLE"); break; @@ -177,14 +174,17 @@ public async Task> GetAllContractAddresses() { var contractAddresses = new List(); try { - - foreach (ContractType contractType in Enum.GetValues(typeof(ContractType)) ) { - var typ = GetContractTypKeccak(contractType); - var env = await localStorage.GetItemAsync("env"); - var contract = await resolverService.GetContractQueryAsync(typ, env); - contractAddresses.Add(new ContractAddress { name = contractType.ToString(), address = contract }); + + // Add in the ContractResolver separately + contractAddresses.Add(new ContractAddress { name = "ContractResolver", address = resolverService.ContractHandler.ContractAddress }); + + foreach (ContractType contractType in Enum.GetValues(typeof(ContractType)) ) { + var typ = GetContractTypKeccak(contractType); + var env = await localStorage.GetItemAsync("env"); + var contract = await resolverService.GetContractQueryAsync(typ, env); + contractAddresses.Add(new ContractAddress { name = contractType.ToString(), address = contract }); + } } - } catch (Exception ex) { Console.WriteLine("Trying to get contract addresses: " + ex.Message); }