mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-20 12:15:51 +00:00
build: Initial linting setup (#1560)
* sets up linting config and runs `yarn lint --fix` once, so that all changes will show up correctly in future PRs. * Note that there are still a lot of linter errors.
This commit is contained in:
committed by
Mayukha Vadari
parent
12cfed5c17
commit
8b95ee5fab
@@ -1,78 +1,77 @@
|
||||
import { ValidationError } from 'xrpl-local/common/errors'
|
||||
import { verifyAccountDelete } from './../../src/models/transactions/accountDelete'
|
||||
import { assert } from 'chai'
|
||||
import { assert } from "chai";
|
||||
|
||||
import { ValidationError } from "xrpl-local/common/errors";
|
||||
|
||||
import { verifyAccountDelete } from "../../src/models/transactions/accountDelete";
|
||||
|
||||
/**
|
||||
* AccountDelete Transaction Verification Testing
|
||||
* AccountDelete Transaction Verification Testing.
|
||||
*
|
||||
* Providing runtime verification testing for each specific transaction type
|
||||
* Providing runtime verification testing for each specific transaction type.
|
||||
*/
|
||||
describe('AccountDelete Transaction Verification', function () {
|
||||
|
||||
it (`verifies valid AccountDelete`, () => {
|
||||
const validAccountDelete = {
|
||||
TransactionType: "AccountDelete",
|
||||
Account: "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm",
|
||||
Destination: "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
|
||||
DestinationTag: 13,
|
||||
Fee: "5000000",
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648
|
||||
} as any
|
||||
|
||||
assert.doesNotThrow(() => verifyAccountDelete(validAccountDelete))
|
||||
})
|
||||
describe("AccountDelete Transaction Verification", function () {
|
||||
it(`verifies valid AccountDelete`, function () {
|
||||
const validAccountDelete = {
|
||||
TransactionType: "AccountDelete",
|
||||
Account: "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm",
|
||||
Destination: "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
|
||||
DestinationTag: 13,
|
||||
Fee: "5000000",
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any;
|
||||
|
||||
assert.doesNotThrow(() => verifyAccountDelete(validAccountDelete));
|
||||
});
|
||||
|
||||
it (`throws w/ missing Destination`, () => {
|
||||
const invalidDestination = {
|
||||
TransactionType: "AccountDelete",
|
||||
Account: "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm",
|
||||
Fee: "5000000",
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648
|
||||
} as any
|
||||
it(`throws w/ missing Destination`, function () {
|
||||
const invalidDestination = {
|
||||
TransactionType: "AccountDelete",
|
||||
Account: "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm",
|
||||
Fee: "5000000",
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any;
|
||||
|
||||
assert.throws(
|
||||
() => verifyAccountDelete(invalidDestination),
|
||||
ValidationError,
|
||||
"AccountDelete: missing field Destination"
|
||||
)
|
||||
})
|
||||
assert.throws(
|
||||
() => verifyAccountDelete(invalidDestination),
|
||||
ValidationError,
|
||||
"AccountDelete: missing field Destination"
|
||||
);
|
||||
});
|
||||
|
||||
it (`throws w/ invalid Destination`, () => {
|
||||
const invalidDestination = {
|
||||
TransactionType: "AccountDelete",
|
||||
Account: "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm",
|
||||
Destination: 65478965,
|
||||
Fee: "5000000",
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648
|
||||
} as any
|
||||
it(`throws w/ invalid Destination`, function () {
|
||||
const invalidDestination = {
|
||||
TransactionType: "AccountDelete",
|
||||
Account: "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm",
|
||||
Destination: 65478965,
|
||||
Fee: "5000000",
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any;
|
||||
|
||||
assert.throws(
|
||||
() => verifyAccountDelete(invalidDestination),
|
||||
ValidationError,
|
||||
"AccountDelete: invalid Destination"
|
||||
)
|
||||
})
|
||||
assert.throws(
|
||||
() => verifyAccountDelete(invalidDestination),
|
||||
ValidationError,
|
||||
"AccountDelete: invalid Destination"
|
||||
);
|
||||
});
|
||||
|
||||
it (`throws w/ invalid DestinationTag`, () => {
|
||||
const invalidDestinationTag = {
|
||||
TransactionType: "AccountDelete",
|
||||
Account: "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm",
|
||||
Destination: "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
|
||||
DestinationTag: "gvftyujnbv",
|
||||
Fee: "5000000",
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648
|
||||
} as any
|
||||
it(`throws w/ invalid DestinationTag`, function () {
|
||||
const invalidDestinationTag = {
|
||||
TransactionType: "AccountDelete",
|
||||
Account: "rWYkbWkCeg8dP6rXALnjgZSjjLyih5NXm",
|
||||
Destination: "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
|
||||
DestinationTag: "gvftyujnbv",
|
||||
Fee: "5000000",
|
||||
Sequence: 2470665,
|
||||
Flags: 2147483648,
|
||||
} as any;
|
||||
|
||||
assert.throws(
|
||||
() => verifyAccountDelete(invalidDestinationTag),
|
||||
ValidationError,
|
||||
"AccountDelete: invalid DestinationTag"
|
||||
)
|
||||
})
|
||||
|
||||
})
|
||||
assert.throws(
|
||||
() => verifyAccountDelete(invalidDestinationTag),
|
||||
ValidationError,
|
||||
"AccountDelete: invalid DestinationTag"
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user