Use new token names HASH/ISA/JADE
those don't conflict with other BCP demo tokens
This commit is contained in:
@@ -2,26 +2,26 @@ import { RequestParser } from "./requestparser";
|
||||
|
||||
describe("RequestParser", () => {
|
||||
it("can process valid credit request", () => {
|
||||
const body = { address: "abc", ticker: "CASH" };
|
||||
expect(RequestParser.parseCreditBody(body)).toEqual({ address: "abc", ticker: "CASH" });
|
||||
const body = { address: "abc", ticker: "TKN" };
|
||||
expect(RequestParser.parseCreditBody(body)).toEqual({ address: "abc", ticker: "TKN" });
|
||||
});
|
||||
|
||||
it("throws for invalid credit requests", () => {
|
||||
// address unset
|
||||
{
|
||||
const body = { ticker: "CASH" };
|
||||
const body = { ticker: "TKN" };
|
||||
expect(() => RequestParser.parseCreditBody(body)).toThrowError(/Property 'address' must be a string/i);
|
||||
}
|
||||
|
||||
// address wrong type
|
||||
{
|
||||
const body = { address: true, ticker: "CASH" };
|
||||
const body = { address: true, ticker: "TKN" };
|
||||
expect(() => RequestParser.parseCreditBody(body)).toThrowError(/Property 'address' must be a string/i);
|
||||
}
|
||||
|
||||
// address empty
|
||||
{
|
||||
const body = { address: "", ticker: "CASH" };
|
||||
const body = { address: "", ticker: "TKN" };
|
||||
expect(() => RequestParser.parseCreditBody(body)).toThrowError(/Property 'address' must not be empty/i);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ export const developmentTokenConfig: TokenConfiguration = {
|
||||
{
|
||||
contractAddress: "cosmos1hqrdl6wstt8qzshwc6mrumpjk9338k0lr4dqxd",
|
||||
fractionalDigits: 0,
|
||||
ticker: "BASH",
|
||||
name: "Bash Token",
|
||||
ticker: "ISA",
|
||||
name: "Isa Token",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -35,8 +35,8 @@ const defaultConfig: TokenConfiguration = {
|
||||
{
|
||||
contractAddress: "cosmos1hqrdl6wstt8qzshwc6mrumpjk9338k0lr4dqxd",
|
||||
fractionalDigits: 0,
|
||||
ticker: "BASH",
|
||||
name: "Bash Token",
|
||||
ticker: "ISA",
|
||||
name: "Isa Token",
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -112,7 +112,7 @@ describe("Faucet", () => {
|
||||
amount: {
|
||||
quantity: "7",
|
||||
fractionalDigits: 0,
|
||||
tokenTicker: "BASH" as TokenTicker,
|
||||
tokenTicker: "ISA" as TokenTicker,
|
||||
},
|
||||
sender: holder,
|
||||
recipient: recipient,
|
||||
@@ -123,7 +123,7 @@ describe("Faucet", () => {
|
||||
{
|
||||
quantity: "7",
|
||||
fractionalDigits: 0,
|
||||
tokenTicker: "BASH" as TokenTicker,
|
||||
tokenTicker: "ISA" as TokenTicker,
|
||||
},
|
||||
]);
|
||||
connection.disconnect();
|
||||
@@ -140,21 +140,21 @@ describe("Faucet", () => {
|
||||
const distributorBalance = (await connection.getAccount({ pubkey: distributors[0].pubkey }))?.balance;
|
||||
assert(distributorBalance);
|
||||
expect(distributorBalance).toEqual([
|
||||
jasmine.objectContaining({
|
||||
tokenTicker: "BASH",
|
||||
fractionalDigits: 0,
|
||||
}),
|
||||
jasmine.objectContaining({
|
||||
tokenTicker: "COSM",
|
||||
fractionalDigits: 6,
|
||||
}),
|
||||
jasmine.objectContaining({
|
||||
tokenTicker: "ISA",
|
||||
fractionalDigits: 0,
|
||||
}),
|
||||
jasmine.objectContaining({
|
||||
tokenTicker: "STAKE",
|
||||
fractionalDigits: 6,
|
||||
}),
|
||||
]);
|
||||
expect(Number.parseInt(distributorBalance[0].quantity, 10)).toBeGreaterThanOrEqual(80);
|
||||
expect(Number.parseInt(distributorBalance[1].quantity, 10)).toBeGreaterThanOrEqual(80_000000);
|
||||
expect(Number.parseInt(distributorBalance[0].quantity, 10)).toBeGreaterThanOrEqual(80_000000);
|
||||
expect(Number.parseInt(distributorBalance[1].quantity, 10)).toBeGreaterThanOrEqual(80);
|
||||
expect(Number.parseInt(distributorBalance[2].quantity, 10)).toBeGreaterThanOrEqual(80_000000);
|
||||
connection.disconnect();
|
||||
});
|
||||
@@ -207,7 +207,7 @@ describe("Faucet", () => {
|
||||
const { profile } = await makeProfile();
|
||||
const faucet = new Faucet(defaultConfig, connection, codec, profile);
|
||||
const tickers = await faucet.loadTokenTickers();
|
||||
expect(tickers).toEqual(["BASH", "COSM", "STAKE"]);
|
||||
expect(tickers).toEqual(["COSM", "ISA", "STAKE"]);
|
||||
connection.disconnect();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -26,11 +26,11 @@ describe("multichainhelpers", () => {
|
||||
{
|
||||
quantity: "1",
|
||||
fractionalDigits: 9,
|
||||
tokenTicker: "CASH" as TokenTicker,
|
||||
tokenTicker: "JADE" as TokenTicker,
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(tickers).toEqual(["CASH"]);
|
||||
expect(tickers).toEqual(["JADE"]);
|
||||
});
|
||||
|
||||
it("works for two tokens", () => {
|
||||
@@ -41,7 +41,7 @@ describe("multichainhelpers", () => {
|
||||
{
|
||||
quantity: "1",
|
||||
fractionalDigits: 9,
|
||||
tokenTicker: "CASH" as TokenTicker,
|
||||
tokenTicker: "JADE" as TokenTicker,
|
||||
},
|
||||
{
|
||||
quantity: "1",
|
||||
@@ -50,7 +50,7 @@ describe("multichainhelpers", () => {
|
||||
},
|
||||
],
|
||||
});
|
||||
expect(tickers).toEqual(["CASH", "TRASH"]);
|
||||
expect(tickers).toEqual(["JADE", "TRASH"]);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user