Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase ticker max length to 9 #45

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion token-metadata-creator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ token-metadata-creator entry 19309eb9c066253cede617dc635223ace320ae0bbdd5bd19684
| Field | Details | Command |
| --- | --- | --- |
| `policy` | the exact script which hashes to the `policyId` | `--policy \| -p` |
| `ticker` | between 2 and 5 UTF-8 characters | `--ticker \| -t` |
| `ticker` | between 2 and 9 UTF-8 characters | `--ticker \| -t` |
| `url` | a valid https URI | `--url \| -h` |
| `logo` | a PNG image file | `--logo \| -l` |

Expand Down
2 changes: 1 addition & 1 deletion token-metadata-creator/src/Cardano/Metadata/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ validateMetadataPolicy t = Policy t <$>

validateMetadataTicker :: MonadFail f => Text -> f Ticker
validateMetadataTicker = fmap Ticker .
(validateMinLength 2 >=> validateMaxLength 5)
(validateMinLength 2 >=> validateMaxLength 9)

validateMetadataDescription :: MonadFail f => Text -> f Description
validateMetadataDescription = fmap Description .
Expand Down
16 changes: 16 additions & 0 deletions token-metadata-creator/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,22 @@ describe("token-metadata-creator", () => {
assert.equal(getDraft(alice).decimals.sequenceNumber, 1);
});


it("Name length [2-9]", () => {
const ticker = `MILKSHAKE`;

cli(alice, "--ticker", ticker);

const empty = { sequenceNumber: 0, signatures: [] };
assert.deepEqual(getDraft(alice).ticker, { ...empty, value: ticker });

try {
cli(alice, "--ticker", `${ticker}+`)
assert.fail("should have thrown.");
} catch (e) {}
})


it("Edit property on successive calls", () => {
let name = "SuperCoin"
cli(alice, "--name", "foo");
Expand Down