From cad959345afb8bf0bd1e5eefe6c63f136833b3ce Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Tue, 22 Dec 2020 21:42:17 -0400 Subject: Properly naming unicode Block type. --- stdlib/source/test/aedifex/repository.lux | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) (limited to 'stdlib/source/test/aedifex/repository.lux') diff --git a/stdlib/source/test/aedifex/repository.lux b/stdlib/source/test/aedifex/repository.lux index ff669d687..5d2b62f57 100644 --- a/stdlib/source/test/aedifex/repository.lux +++ b/stdlib/source/test/aedifex/repository.lux @@ -17,7 +17,10 @@ [collection ["." dictionary (#+ Dictionary)]]] [math - ["." random (#+ Random)]]] + ["." random (#+ Random)]] + [world + [net + ["." uri (#+ URI)]]]] [// ["@." artifact]] {#spec @@ -42,41 +45,34 @@ (-> Version Artifact) (|>> ["com.github.luxlang" "test-artifact"])) -(def: item-hash - (Hash [Artifact Extension]) - (product.hash //artifact.hash - text.hash)) - -(exception: (not-found {artifact Artifact} - {extension Extension}) +(exception: (not-found {uri URI}) (exception.report - ["Artifact" (//artifact.format artifact)] - ["Extension" (%.text extension)])) + ["URI" (%.text uri)])) (exception: (invalid-identity {[user _] Identity}) (exception.report ["User" (%.text user)])) (type: Store - (Dictionary [Artifact Extension] Binary)) + (Dictionary URI Binary)) (def: #export empty Store - (dictionary.new ..item-hash)) + (dictionary.new text.hash)) (structure: #export (simulation identity) (-> Identity (/.Simulation Store)) - (def: (on-download artifact extension state) - (case (dictionary.get [artifact extension] state) + (def: (on-download uri state) + (case (dictionary.get uri state) (#.Some content) (exception.return [state content]) #.None - (exception.throw ..not-found [artifact extension]))) - (def: (on-upload requester artifact extension content state) + (exception.throw ..not-found [uri]))) + (def: (on-upload requester uri content state) (if (\ identity-equivalence = identity requester) - (exception.return (dictionary.put [artifact extension] content state)) + (exception.return (dictionary.put uri content state)) (exception.throw ..invalid-identity [requester])))) (def: #export test -- cgit v1.2.3