This enhancement adds the load_core_schema dance to the MAP's dance card. This dance requests a bulk load of the MAP's core (L0) descriptors. The functionality of the actual schema loader will be trivially small initially so that the basic dance logic can be tested. The schema loader can then incrementally add more and more elements (via Issue #87). To keep things simple, this enhancement will use the existing dances design that has a central dispatch table and places adapter files in the dances zome. It will also retain the existing descriptors test strategy. In the future, generalizing the DanceTestCase approach to MapTestCase and MapTestStep will allow us to bring a uniform testing infrastructure to all zomes.
Proposal
Enhance Native Descriptors functionality
[x] Implement a minimal load_core_schema function within the descriptors zome:
[x] Introduce a _descriptors_danceadapter.rs file to the dances zome
[x] Define and implement a new load_core_schema dance adapter function as a Standalone dance that has an empty request body and that returns the Schema holon in the response body. It should delegate the call to the descriptors zome's load_core_schema function. Note that responsibility for commits is within the guest-side load_core_schema function so that the choice of whether to do intermediate commits can be encapsulated on the guest-side.
[x] Implement build_load_core_schema_dance_request as a Standalone request.
[x] Add "load_core_schema" dance to the Dancer's dispatch table
_In the dance_response.rs file:_
No changes needed.
Testing Enhancements
_In the dances zome's tests directory, add a descriptor_fixtures.rs file:_
[x] implement load_core_schema_test_fixture()->Result<DancesTestCase, HolonError>. This fixture adds a single load_core_schema test step, followed by an ensure_db_count test step.
_In the test_data_types.rs file:_
[x] Add LoadCoreSchema to the DanceTestStep enum & its fmt function
This enhancement adds the
load_core_schema
dance to the MAP's dance card. This dance requests a bulk load of the MAP's core (L0) descriptors. The functionality of the actual schema loader will be trivially small initially so that the basic dance logic can be tested. The schema loader can then incrementally add more and more elements (via Issue #87). To keep things simple, this enhancement will use the existing dances design that has a central dispatch table and places adapter files in the dances zome. It will also retain the existing descriptors test strategy. In the future, generalizing the DanceTestCase approach toMapTestCase
andMapTestStep
will allow us to bring a uniform testing infrastructure to all zomes.Proposal
Enhance Native Descriptors functionality
load_core_schema
function within the descriptors zome:pub fn load_core_schema(context: &HolonsContext) -> Result<Holon, HolonError>
Dance Enhancements
load_core_schema
dance adapter function as a Standalone dance that has an empty request body and that returns the Schema holon in the response body. It should delegate the call to the descriptors zome'sload_core_schema
function. Note that responsibility for commits is within the guest-sideload_core_schema
function so that the choice of whether to do intermediate commits can be encapsulated on the guest-side.build_load_core_schema_dance_request
as a Standalone request.In the dancer.rs file:
_In the dance_response.rs file:_ No changes needed.
Testing Enhancements
_In the dances zome's tests directory, add a descriptor_fixtures.rs file:_
load_core_schema_test_fixture()->Result<DancesTestCase, HolonError>
. This fixture adds a single load_core_schema test step, followed by an ensure_db_count test step._In the test_data_types.rs file:_
Definition of Done:
load_core_schema_test
, test case passes