hyperledger-labs / perun-node

State channel node of the blockchain-agnostic state channels framework Perun.
https://labs.hyperledger.org/perun-doc/
Apache License 2.0
18 stars 12 forks source link

Add APIs to register currency interepreters and deploy ERC20 asset holders. #194

Closed manoranjith closed 3 years ago

manoranjith commented 3 years ago

Motivation / Context

Sub task of #192.

Description

Add an API to deploy new ERC20 adjudicator contracts and another to register new currencies when new ERC20 adjudicator contracts are already deployed.

Relates to

192.

Testing

  1. In case of deploy, the API should

    • Check before the deploy transaction if the token is already registered. If yes, should return an error.
    • Check before the deploy transaction, if Symbol and Decimals can be read from the token contract. If not, should return an error.
    • If deploy transaction fails, appropriate error should be returned.
  2. In case of register token, it should return an error if

    • the token is already registered.
    • if symbol and decimals cannot be read from the token contract.

Thread Safety