Skip to content
CCPEDIAby Unity Nodes
App Development

Testing Triggers: `testRule` : Auto-build ACS instead of manually building it?

3 posts134 viewsLast activity May 2022

  1. StephenOTTOP

    From the examples to test a trigger, you use the testRule function. This function takes a ACSBuilder which is manually built from the objects provided. is there a function / way to auto-build the acs based on previous actions take in a test?

    In a test, if i ran:

    objA <- submit alice do
            createCmd Object1 with
                user1 = alice
    
    objB <- submit alice do
            createCmd Object1 with
                user1 = alice
    
    objC <- submit alice do
            createCmd Object1 with
                user1 = alice
    
    

    It would generate 3 contracts in the ACS / ledger / test context. I could then run the testRule and say “use the current ACS from this test context”.

    Is this possible?

  2. cocreature

    Currently this is not possible. There is an open feature request for this though.

  3. StephenOTT

    Thanks