mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2024-12-25 23:39:38 -05:00
test currency code & address validation on create crypto acct (disabled)
This commit is contained in:
parent
8f295421c3
commit
c5e74947d5
@ -676,7 +676,7 @@ test("Can get market prices", async () => {
|
|||||||
expect(btc).toBeLessThan(0.4);
|
expect(btc).toBeLessThan(0.4);
|
||||||
|
|
||||||
// test invalid currency
|
// test invalid currency
|
||||||
await expect(async () => {await alice.getPrice("INVALID_CURRENCY")})
|
await expect(async () => { await alice.getPrice("INVALID_CURRENCY") })
|
||||||
.rejects
|
.rejects
|
||||||
.toThrow('Currency not found: INVALID_CURRENCY');
|
.toThrow('Currency not found: INVALID_CURRENCY');
|
||||||
});
|
});
|
||||||
@ -856,12 +856,22 @@ test("Can create crypto payment accounts", async () => {
|
|||||||
if (!fetchedAccount) throw new Error("Payment account not found after being added");
|
if (!fetchedAccount) throw new Error("Payment account not found after being added");
|
||||||
testCryptoPaymentAccount(paymentAccount);
|
testCryptoPaymentAccount(paymentAccount);
|
||||||
testCryptoPaymentAccountEquals(fetchedAccount, testAccount, name);
|
testCryptoPaymentAccountEquals(fetchedAccount, testAccount, name);
|
||||||
|
|
||||||
// TODO (woodser): test rejecting account with invalid currency code
|
|
||||||
// TODO (woodser): test rejecting account with invalid address
|
|
||||||
// TODO (woodser): test rejecting account with duplicate name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO (woodser): update from latest Bisq CorePaymentAccountService.java for currency and address validation
|
||||||
|
|
||||||
|
/* // test invalid currency code
|
||||||
|
await expect(async () => { await alice.createCryptoPaymentAccount("My account", "ABC", "123"); })
|
||||||
|
.rejects
|
||||||
|
.toThrow('Unsupported cryptocurrency code: ABC');
|
||||||
|
|
||||||
|
// test invalid address
|
||||||
|
await expect(async () => { await alice.createCryptoPaymentAccount("My account", "ETH", "123"); })
|
||||||
|
.rejects
|
||||||
|
.toThrow('Invalid address');*/
|
||||||
|
|
||||||
|
// TODO (woodser): test rejecting account with duplicate name
|
||||||
|
|
||||||
function testCryptoPaymentAccountEquals(paymentAccount: PaymentAccount, testAccount: any, name: string) {
|
function testCryptoPaymentAccountEquals(paymentAccount: PaymentAccount, testAccount: any, name: string) {
|
||||||
expect(paymentAccount.getAccountName()).toEqual(name);
|
expect(paymentAccount.getAccountName()).toEqual(name);
|
||||||
expect(paymentAccount.getPaymentAccountPayload()!.getCryptoCurrencyAccountPayload()!.getAddress()).toEqual(testAccount.address);
|
expect(paymentAccount.getPaymentAccountPayload()!.getCryptoCurrencyAccountPayload()!.getAddress()).toEqual(testAccount.address);
|
||||||
|
Loading…
Reference in New Issue
Block a user