OutputSource constructor need a string for the condition, should be a Condition instance
When I have cleaned up the OutputSource and Condition types, I thought that it will be more simple for a developer to give a string for the condition argument in the OutputSource constructor.
But refactoring Sakia, the Condition instance given in the constructor is more secure.
The developer should not write himself the condition script. He should delegate it to the dedicated classes. With this in mind, OutputSource class and every class dealing with condition scripts should be given an instance of Condition.
With a string we have for now (bad idea):
OutputSource(
amount=source["amount"],
base=source["base"],
condition="SIG({0})".format(to_pubkey),
)
or as bad:
OutputSource(
mount=output_sum,
base=base,
condition=pypeg2.compose(output.Condition.token(output.SIG.token(receiver)), output.Condition)
)
it should be this:
OutputSource(
mount=output_sum,
base=base,
condition=output.Condition.token(output.SIG.token(receiver))
))