1 module tagion.testbench.services.transaction; 2 // Default import list for bdd 3 import std.typecons : Tuple; 4 import tagion.behaviour; 5 import tagion.hibon.Document; 6 import tagion.testbench.tools.Environment; 7 8 enum feature = Feature( 9 "Transcript service", 10 [ 11 "This service takes care of processing the consensus-ordered list of smart-contracts (here in called an epoch list).", 12 "The service should check the smart-contracts in-order and check that the inputs has not been used.", 13 "The collected result should as a modifications updates to the DART-Service." 14 ]); 15 16 alias FeatureContext = Tuple!( 17 ProcessAnEpochlistWithAllValidEpochs, "ProcessAnEpochlistWithAllValidEpochs", 18 ProcessAnEpochlistWhereTheInputsAreReused, "ProcessAnEpochlistWhereTheInputsAreReused", 19 FeatureGroup*, "result" 20 ); 21 22 @safe @Scenario("Process an epoch-list with all valid epochs", 23 []) 24 class ProcessAnEpochlistWithAllValidEpochs { 25 26 @Given("a list of contract where all the contracts has been executed bye the TVM-service.") 27 Document tVMservice() { 28 return Document(); 29 } 30 31 @Given("a list of valid contract in an epoch-list.") 32 Document epochlist() { 33 return Document(); 34 } 35 36 @When("the epoch-list and the list of contract is available.") 37 Document available() { 38 return Document(); 39 } 40 41 @Then("the Recorder received to DART-Services should be checked that it contains the correct modifications.") 42 Document modifications() { 43 return Document(); 44 } 45 46 } 47 48 @safe @Scenario("Process an epoch-list where the inputs are reused", 49 [ 50 "This scenario checks for double spending when the same input is available for several smart-contracts in only the first in the process should be executed.", 51 "And all the smart contracts which use the same input should be given processed but the penalty process." 52 ]) 53 class ProcessAnEpochlistWhereTheInputsAreReused { 54 55 @Given("a list of valid inputs collected in the TVM service.") 56 Document service() { 57 return Document(); 58 } 59 60 @Given("an epoch-list where some of the inputs are used multiple time.") 61 Document time() { 62 return Document(); 63 } 64 65 @When("the epoch-list and the list of contract is available.") 66 Document available() { 67 return Document(); 68 } 69 70 @When("the transcript services have been executed the smart-contracts the Recorder produces should be sent to the DART-Services") 71 Document dARTServices() { 72 return Document(); 73 } 74 75 @Then("the Recorder received to DART-Services should be checked that it contains the correct modifications.") 76 Document modifications() { 77 return Document(); 78 } 79 80 @Then("the Recorder received should be checked that it contains the correct modifications and check that the penalty has been performed on the inputs which are used in multiple contracts.") 81 Document contracts() { 82 return Document(); 83 } 84 85 }