wamp-proto / wamp-xbr

The XBR Protocol - blockchain protocol for decentralized open data markets
https://xbr.network
Other
11 stars 16 forks source link

Inconsistency between ActorType and ChannelType #109

Open oberstet opened 4 years ago

oberstet commented 4 years ago
    /// All XBR market actor types defined.
    enum ActorType { NULL, PROVIDER, CONSUMER, PROVIDER_CONSUMER }

    /// All XBR state channel types defined.
    enum ChannelType { NULL, PAYMENT, PAYING }

that is, eg actor ActorType.PROVIDER == 1, but the correpsonding channel has ChannelType.PAYING == 2

oberstet commented 4 years ago

note that formally this doesn't matter (it is not a bug ..), but it is highly confusing and a trap in practice. we should fix it soon before it's too late ..

the fix is changing to

    /// All XBR state channel types defined.
    enum ChannelType { NULL, PAYING, PAYMENT }

that way ActorType.PROVIDER == ChannelType.PAYING == 1