dhiway / cord.js

Cord JS API
Apache License 2.0
37 stars 49 forks source link

Improve SDK Behavior for Duplicate Statement Anchoring #177

Closed adi-a11y closed 1 month ago

adi-a11y commented 7 months ago

Description: When attempting to anchor a statement that is already present on the chain using the SDK, the current behaviour is confusing. The SDK returns the identifier without errors and no events are observed on the chain. It becomes perplexing because, while the terminal indicates that the dispatch call has been executed, there are no corresponding events observable on the chain. Consequently, one is left pondering why no error is displayed or why the event is absent on the chain, despite the SDK indicating successful execution without errors.

Proposed Fix: If the statement is already anchored on the chain, the SDK should throw an error indicating "The statement already exists" and should also return the identifier for reference.

vatsa287 commented 1 month ago

Closing as completed with #178.