vocdoni / interoperability

Private repository to manage the interoperability between protocol, API, SDK, UIs and documentation
1 stars 0 forks source link

new transaction: set process duration #189

Open p4u opened 1 week ago

p4u commented 1 week ago

With this transaction, we can now modify the duration of an existing process (while in READY or PAUSE state).

If interruptible=false the duration can only be extended.

The cost of the transactions is computed dynamically by: max(newPrice - previousPrice, txBaseCost)

The required new fields already exist on the protobuf models (they were added some weeks ago), so the SDK should have already everything available.

The new transaction is of type: SetProcessTx / SET_PROCESS_DURATION https://github.com/vocdoni/dvote-protobuf/blob/master/src/vochain/vochain.proto#L168

The new field is uint32 duration and represents seconds. https://github.com/vocdoni/dvote-protobuf/blob/master/src/vochain/vochain.proto#L218

The duration is added to startTime to compute the new endTime: endTime = startTime + duration

EndTime cannot be lower than the current blockchain time, and duration must be different from zero.

PS: it would be great to add this feature to the UI, so the process end time can be set at any moment by the organizer or a delegate. cc/ @jpaulet

p4u commented 1 week ago

PR: https://github.com/vocdoni/vocdoni-node/pull/1344

marcvelmer commented 1 week ago

Done in the SDK