Skip to content

Commit

Permalink
SystemRegistrationBuilder fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
juanfranblanco committed May 16, 2024
1 parent 24546cd commit 053f023
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public List<RegisterRootFunctionSelectorFunction> CreateRegisterRootFunctionSele
{
excludedRegisteredSelectors.AddRange(new SystemDefaultFunctions().GetAllFunctionSignatures().ToList());
}
excludedRegisteredSelectors.AddRange(new SystemDefaultFunctions().GetAllFunctionSignatures().ToList());

var functionAbis = functionABIs;
var functionSelectorsToRegister = functionAbis.Where(x => !excludedRegisteredSelectors.Any(y => y.IsTheSameHex(x.Sha3Signature))).ToList();

Expand All @@ -55,6 +55,7 @@ public List<RegisterRootFunctionSelectorFunction> CreateRegisterRootFunctionSele
registerFunction.SystemFunctionSignature = functionSelectorToRegister.Signature;
registerFunction.WorldFunctionSignature = functionSelectorToRegister.Signature;
registerFunction.SystemId = systemResourceId;
registerFunctionSelectors.Add(registerFunction);
}
return registerFunctionSelectors;
}
Expand All @@ -73,7 +74,7 @@ public List<RegisterRootFunctionSelectorFunction> CreateRegisterFunctionSelector
var registerSystemFunction = new RegisterSystemFunction();
registerSystemFunction.SystemId = systemServiceResourceRegistration.Resource.ResourceIdEncoded;
registerSystemFunction.System = deployedAddress;
registerSystemFunction.PublicAccess = true;
registerSystemFunction.PublicAccess = publicAccess;
return registerSystemFunction;
}

Expand Down
24 changes: 4 additions & 20 deletions tests/Nethereum.Mud.IntegrationTests/WorldDeploymentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,13 @@ public async Task ShouldDeployWorldContractRegisterTablesSystemAndInteractSimpli
var registrationSystemService = world.Systems.RegistrationSystem;
//TODO NAMESPACE registration in NamespaceService

var nameSpaceReceipt = registrationSystemService.RegisterNamespaceRequestAndWaitForReceiptAsync(
var nameSpaceReceipt = registrationSystemService.RegisterNamespaceRequestAndWaitForReceiptAsync(
ResourceEncoder.EncodeNamesapce(String.Empty));



await mudTest.Tables.BatchRegisterAllTablesRequestAndWaitForReceiptAsync();

// await mudTest.Tables.BatchRegisterAllTablesRequestAndWaitForReceiptAsync();


var tables = await store.Tables.TablesTableService.GetRecordsFromLogsAsync();

Expand Down Expand Up @@ -277,23 +276,8 @@ public async Task ShouldDeployWorldContractRegisterTablesSystemAndInteractSimpli


var deployAllResult = await mudTest.Systems.DeployAllCreate2ContractSystemsRequestAsync(addressDeployer, salt);
try
{
var registerAllReceipt = await mudTest.Systems.BatchRegisterAllSystemsRequestAndWaitForReceiptAsync(addressDeployer, salt);
}
catch (SmartContractCustomErrorRevertException e)
{
var errorTypes = registrationSystemService.GetAllErrorTypes();
foreach (var errorType in errorTypes)
{
if (e.IsCustomErrorFor(errorType))
{
Debug.WriteLine(errorType.ToString());
throw;
}
}

}
var registerAllReceipt = await mudTest.Systems.BatchRegisterAllSystemsRequestAndWaitForReceiptAsync(addressDeployer, salt);

await mudTest.Systems.IncrementSystemService.IncrementRequestAndWaitForReceiptAsync();

var counterRecord = await mudTest.Tables.CounterTableService.GetTableRecordAsync();
Expand Down

0 comments on commit 053f023

Please sign in to comment.