Skip to content
This repository was archived by the owner on Jan 1, 2020. It is now read-only.
This repository was archived by the owner on Jan 1, 2020. It is now read-only.

Implement custom code embedding/inclusion #13

@expede

Description

@expede

Via @carchrae

the examples are great, but i wonder if there isn't a more elegant way to map a validator to the hex for app specific reasons, (eg, x05 in

if (_amount < 1000) { return Status.Reason.x05; }
). like if there was a helper that mapped `FinancialValidator.reasons = customCodes([ 'insufficientFunds']) - or some other method to avoid pointing to magic strings. )

A user should be able to map names from a custom enum into the main code set

For example

contract Phone {
    enum Call {
        Disconnected,
        Connected,
        CallStarted,
        OnHold
    }
}

customCode(Phone.Call.Disconnected) == hex"A0"
// true

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions