What problem does your feature solve?
Sometimes I want to generate particular types of ledger keys, or particular variants of complex unions / enums in the xdr. I find myself using stellar-xdr generate arbitrary --type <type> --output json and then just running it multiple times until I hit the subtype construction I am looking for.
What would you like to see?
A way to conveniently narrow the arbitrary inputs or the filter the output by key words or contents.
Possibly all that is needed here is to put the generation in a loop, and keep trying generations until the resulting json contains the passed in string.
What alternatives are there?
We could build a more specific DSL of sorts where you could use options to specify sub-values or sub-types of unions. I don't think we should do that because from an engineering perspective this seems more complex, more code to maintain, where-as a somewhat hacky proposal above would deliver 80% of the value at a fraction of the cost.
What problem does your feature solve?
Sometimes I want to generate particular types of ledger keys, or particular variants of complex unions / enums in the xdr. I find myself using
stellar-xdr generate arbitrary --type <type> --output jsonand then just running it multiple times until I hit the subtype construction I am looking for.What would you like to see?
A way to conveniently narrow the arbitrary inputs or the filter the output by key words or contents.
Possibly all that is needed here is to put the generation in a loop, and keep trying generations until the resulting json contains the passed in string.
What alternatives are there?
We could build a more specific DSL of sorts where you could use options to specify sub-values or sub-types of unions. I don't think we should do that because from an engineering perspective this seems more complex, more code to maintain, where-as a somewhat hacky proposal above would deliver 80% of the value at a fraction of the cost.