Skip to content

Commit

Permalink
Merge pull request #45 from SundaeSwap-finance/increase-ticker-max-le…
Browse files Browse the repository at this point in the history
…ngth

Increase ticker max length to 9
  • Loading branch information
sevanspowell committed Jan 20, 2022
2 parents 0ef402f + deaaa96 commit d8786f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
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

0 comments on commit d8786f4

Please sign in to comment.