Compare commits

..

8 Commits

Author SHA1 Message Date
Elliot Lee
4140cccaca Merge branch 'main' into expanded-signer-list 2022-06-23 09:38:17 -07:00
Omar Khan
082fe492e0 Merge branch 'main' into expanded-signer-list 2022-06-15 18:54:01 -04:00
Omar Khan
993d155cf3 add WalletLocator validation 2022-06-15 18:45:20 -04:00
Omar Khan
1571e30653 update test 2022-06-15 17:01:35 -04:00
Omar Khan
3b68781a14 add jsdoc to SignerEntry 2022-06-15 16:55:46 -04:00
Omar Khan
1fa277676c update HISTORY.md 2022-06-14 17:55:47 -04:00
Omar Khan
927172a65f add optional WalletLocator to SignerEntry 2022-06-14 17:47:26 -04:00
Omar Khan
663415b23f expand the maximum signer list to 32 entries 2022-06-14 17:34:20 -04:00
10 changed files with 209 additions and 75 deletions

View File

@@ -18,12 +18,11 @@ jobs:
node-version: [14.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install -g npm@7
- run: npm ci
- run: npm run build
@@ -38,13 +37,11 @@ jobs:
node-version: [12.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm install -g npm@7
- run: npm ci
- run: npm run build
@@ -66,13 +63,11 @@ jobs:
--health-cmd="wget localhost:6006 || exit 1" --health-interval=5s --health-retries=10 --health-timeout=2s
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm install -g npm@7
- run: npm ci
- run: npm run build
@@ -102,8 +97,6 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm install -g npm@7
- run: npm ci
- run: npm run build

86
package-lock.json generated
View File

@@ -3304,9 +3304,8 @@
}
},
"node_modules/@xrplf/eslint-config": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/@xrplf/eslint-config/-/eslint-config-1.8.0.tgz",
"integrity": "sha512-75gwLZbHcSgcMFcQtX6q9p075jRhA1f5azmE7cUgw8qY0Wx8h2B99qMHGDelfO1EOwueuSOPIf8qC36+7zHFmQ==",
"version": "1.6.0",
"integrity": "sha512-igWdZB/X/k6MvRXb+4ZYwJHO7SewnL/zkhNJyVy+8zrcGcgSbJcAh3bPtRaBifse4WaGvyh42u2xGpGFT8E9DQ==",
"dev": true,
"dependencies": {
"confusing-browser-globals": "^1.0.9",
@@ -3318,18 +3317,18 @@
"npm": ">= 7.0.0 < 8.0.0"
},
"peerDependencies": {
"@typescript-eslint/eslint-plugin": ">= 4.30.0",
"@typescript-eslint/parser": ">= 4.30.0",
"eslint": ">= 7.5.0",
"eslint-plugin-array-func": ">= 3.1.6",
"@typescript-eslint/eslint-plugin": ">= 4.30.0 < 5",
"@typescript-eslint/parser": ">= 4.30.0 < 5",
"eslint": ">= 7.5.0 < 8",
"eslint-plugin-array-func": ">= 3.1.6 < 4",
"eslint-plugin-consistent-default-export-name": ">= 0.0.13",
"eslint-plugin-eslint-comments": ">= 3.2.0",
"eslint-plugin-import": ">= 2.22.0",
"eslint-plugin-jsdoc": ">= 36.0.8",
"eslint-plugin-node": ">= 11.1.0",
"eslint-plugin-eslint-comments": ">= 3.2.0 < 4",
"eslint-plugin-import": ">= 2.22.0 < 3",
"eslint-plugin-jsdoc": ">= 36.0.8 < 37",
"eslint-plugin-node": ">= 11.1.0 < 12",
"eslint-plugin-prettier": "~4.0",
"eslint-plugin-tsdoc": ">= 0.2.5",
"prettier": ">= 2.0.5",
"prettier": ">= 2.0.5 < 3",
"typescript": ">= 3.9.0"
}
},
@@ -6999,8 +6998,7 @@
},
"node_modules/filter-obj": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz",
"integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==",
"integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=",
"dev": true,
"engines": {
"node": ">=0.10.0"
@@ -12618,9 +12616,8 @@
}
},
"node_modules/parse-path": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/parse-path/-/parse-path-4.0.4.tgz",
"integrity": "sha512-Z2lWUis7jlmXC1jeOG9giRO2+FsuyNipeQ43HAjqAZjwSe3SEf+q/84FGPHoso3kyntbxa4c4i77t3m6fGf8cw==",
"version": "4.0.3",
"integrity": "sha512-9Cepbp2asKnWTJ9x2kpw6Fe8y9JDbqwahGCTvklzd/cEq5C5JC59x2Xb0Kx+x0QZ8bvNquGO8/BWP0cwBHzSAA==",
"dev": true,
"dependencies": {
"is-ssh": "^1.3.0",
@@ -12630,14 +12627,13 @@
}
},
"node_modules/parse-url": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/parse-url/-/parse-url-6.0.2.tgz",
"integrity": "sha512-uCSjOvD3T+6B/sPWhR+QowAZcU/o4bjPrVBQBGFxcDF6J6FraCGIaDBsdoQawiaaAVdHvtqBe3w3vKlfBKySOQ==",
"version": "6.0.0",
"integrity": "sha512-cYyojeX7yIIwuJzledIHeLUBVJ6COVLeT4eF+2P6aKVzwvgKQPndCBv3+yQ7pcWjqToYwaligxzSYNNmGoMAvw==",
"dev": true,
"dependencies": {
"is-ssh": "^1.3.0",
"normalize-url": "^6.1.0",
"parse-path": "^4.0.4",
"parse-path": "^4.0.0",
"protocols": "^1.4.0"
}
},
@@ -13109,9 +13105,8 @@
}
},
"node_modules/qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"version": "6.10.1",
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
"dev": true,
"dependencies": {
"side-channel": "^1.0.4"
@@ -13125,7 +13120,6 @@
},
"node_modules/query-string": {
"version": "6.14.1",
"resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz",
"integrity": "sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw==",
"dev": true,
"dependencies": {
@@ -14596,7 +14590,6 @@
},
"node_modules/split-on-first": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz",
"integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==",
"dev": true,
"engines": {
@@ -14791,8 +14784,7 @@
},
"node_modules/strict-uri-encode": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz",
"integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==",
"integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=",
"dev": true,
"engines": {
"node": ">=4"
@@ -16712,7 +16704,7 @@
}
},
"packages/ripple-binary-codec": {
"version": "1.4.2",
"version": "1.4.1",
"integrity": "sha512-XMRCbFXyG+dGp3x7tMs9IwA+FVWPPaGjdHYW2+g4Q/WQJqFp5MRED+jjOBOUafmrW4TUsOn1PEEdbB4ozWbDBw==",
"license": "ISC",
"dependencies": {
@@ -16751,7 +16743,7 @@
}
},
"packages/xrpl": {
"version": "2.3.1",
"version": "2.3.0",
"integrity": "sha512-NmrSYpXym7NzGABeXU1H8g4ZtCxRhr/3wu0lguxzcIYpcKPgWLYimg+s9NLLNbPWTZdxXu9SeSWu5zh4gyqAeA==",
"license": "ISC",
"dependencies": {
@@ -16761,7 +16753,7 @@
"https-proxy-agent": "^5.0.0",
"lodash": "^4.17.4",
"ripple-address-codec": "^4.2.4",
"ripple-binary-codec": "^1.4.2",
"ripple-binary-codec": "^1.4.1",
"ripple-keypairs": "^1.1.4",
"ws": "^8.2.2"
},
@@ -19358,9 +19350,8 @@
"requires": {}
},
"@xrplf/eslint-config": {
"version": "1.8.0",
"resolved": "https://registry.npmjs.org/@xrplf/eslint-config/-/eslint-config-1.8.0.tgz",
"integrity": "sha512-75gwLZbHcSgcMFcQtX6q9p075jRhA1f5azmE7cUgw8qY0Wx8h2B99qMHGDelfO1EOwueuSOPIf8qC36+7zHFmQ==",
"version": "1.6.0",
"integrity": "sha512-igWdZB/X/k6MvRXb+4ZYwJHO7SewnL/zkhNJyVy+8zrcGcgSbJcAh3bPtRaBifse4WaGvyh42u2xGpGFT8E9DQ==",
"dev": true,
"requires": {
"confusing-browser-globals": "^1.0.9",
@@ -22223,8 +22214,7 @@
},
"filter-obj": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-1.1.0.tgz",
"integrity": "sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==",
"integrity": "sha1-mzERErxsYSehbgFsbF1/GeCAXFs=",
"dev": true
},
"find-cache-dir": {
@@ -26438,9 +26428,8 @@
}
},
"parse-path": {
"version": "4.0.4",
"resolved": "https://registry.npmjs.org/parse-path/-/parse-path-4.0.4.tgz",
"integrity": "sha512-Z2lWUis7jlmXC1jeOG9giRO2+FsuyNipeQ43HAjqAZjwSe3SEf+q/84FGPHoso3kyntbxa4c4i77t3m6fGf8cw==",
"version": "4.0.3",
"integrity": "sha512-9Cepbp2asKnWTJ9x2kpw6Fe8y9JDbqwahGCTvklzd/cEq5C5JC59x2Xb0Kx+x0QZ8bvNquGO8/BWP0cwBHzSAA==",
"dev": true,
"requires": {
"is-ssh": "^1.3.0",
@@ -26450,14 +26439,13 @@
}
},
"parse-url": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/parse-url/-/parse-url-6.0.2.tgz",
"integrity": "sha512-uCSjOvD3T+6B/sPWhR+QowAZcU/o4bjPrVBQBGFxcDF6J6FraCGIaDBsdoQawiaaAVdHvtqBe3w3vKlfBKySOQ==",
"version": "6.0.0",
"integrity": "sha512-cYyojeX7yIIwuJzledIHeLUBVJ6COVLeT4eF+2P6aKVzwvgKQPndCBv3+yQ7pcWjqToYwaligxzSYNNmGoMAvw==",
"dev": true,
"requires": {
"is-ssh": "^1.3.0",
"normalize-url": "^6.1.0",
"parse-path": "^4.0.4",
"parse-path": "^4.0.0",
"protocols": "^1.4.0"
}
},
@@ -26811,9 +26799,8 @@
"dev": true
},
"qs": {
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"version": "6.10.1",
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
"dev": true,
"requires": {
"side-channel": "^1.0.4"
@@ -26821,7 +26808,6 @@
},
"query-string": {
"version": "6.14.1",
"resolved": "https://registry.npmjs.org/query-string/-/query-string-6.14.1.tgz",
"integrity": "sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw==",
"dev": true,
"requires": {
@@ -27964,7 +27950,6 @@
},
"split-on-first": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/split-on-first/-/split-on-first-1.1.0.tgz",
"integrity": "sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==",
"dev": true
},
@@ -28120,8 +28105,7 @@
},
"strict-uri-encode": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz",
"integrity": "sha512-QwiXZgpRcKkhTj2Scnn++4PKtWsH0kpzZ62L2R6c/LUVYv7hVnZqcg2+sMuT6R7Jusu1vviK/MFsu6kNJfWlEQ==",
"integrity": "sha1-ucczDHBChi9rFC3CdLvMWGbONUY=",
"dev": true
},
"string_decoder": {
@@ -29441,7 +29425,7 @@
"https-proxy-agent": "^5.0.0",
"lodash": "^4.17.4",
"ripple-address-codec": "^4.2.4",
"ripple-binary-codec": "^1.4.2",
"ripple-binary-codec": "^1.4.1",
"ripple-keypairs": "^1.1.4",
"ws": "^8.2.2",
"xrpl-local": "file:src"

View File

@@ -1,8 +1,6 @@
# ripple-binary-codec Release History
## Unreleased
## 1.4.2 (2022-06-27)
- Fixed standard currency codes with lowercase and allowed symbols not decoding into standard codes.
## 1.4.1 (2022-06-02)

View File

@@ -1,6 +1,6 @@
{
"name": "ripple-binary-codec",
"version": "1.4.2",
"version": "1.4.1",
"description": "XRP Ledger binary codec",
"files": [
"dist/*",

View File

@@ -3,12 +3,11 @@
Subscribe to [the **xrpl-announce** mailing list](https://groups.google.com/g/xrpl-announce) for release announcements. We recommend that xrpl.js (ripple-lib) users stay up-to-date with the latest stable release.
## Unreleased
## 2.3.1 (2022-06-27)
### Fixed
* Signing tx with standard currency codes with lowercase and allowed symbols causing an error on decode.
### Added
* Add ExpandedSignerList amendment support
* When connected to nft-devnet, Client.fundWallet now defaults to using the nft-devnet faucet instead of requiring specification.
## 2.3.0 (2022-06-02)

View File

@@ -1,6 +1,6 @@
{
"name": "xrpl",
"version": "2.3.1",
"version": "2.3.0",
"lockfileVersion": 2,
"requires": true,
"packages": {

View File

@@ -1,6 +1,6 @@
{
"name": "xrpl",
"version": "2.3.1",
"version": "2.3.0",
"license": "ISC",
"description": "A TypeScript/JavaScript API for interacting with the XRP Ledger in Node.js and the browser",
"files": [
@@ -27,7 +27,7 @@
"https-proxy-agent": "^5.0.0",
"lodash": "^4.17.4",
"ripple-address-codec": "^4.2.4",
"ripple-binary-codec": "^1.4.2",
"ripple-binary-codec": "^1.4.1",
"ripple-keypairs": "^1.1.4",
"ws": "^8.2.2"
},

View File

@@ -61,10 +61,31 @@ interface PathStep {
export type Path = PathStep[]
/**
* The object that describes the signer in SignerEntries.
*/
export interface SignerEntry {
/**
* The object that describes the signer in SignerEntries.
*/
SignerEntry: {
/**
* An XRP Ledger address whose signature contributes to the multi-signature.
* It does not need to be a funded address in the ledger.
*/
Account: string
/**
* The weight of a signature from this signer.
* A multi-signature is only valid if the sum weight of the signatures provided meets
* or exceeds the signer list's SignerQuorum value.
*/
SignerWeight: number
/**
* An arbitrary 256-bit (32-byte) field that can be used to identify the signer, which
* may be useful for smart contracts, or for identifying who controls a key in a large
* organization.
*/
WalletLocator?: string
}
}

View File

@@ -20,13 +20,15 @@ export interface SignerListSet extends BaseTransaction {
/**
* Array of SignerEntry objects, indicating the addresses and weights of
* signers in this list. This signer list must have at least 1 member and no
* more than 8 members. No address may appear more than once in the list, nor
* more than 32 members. No address may appear more than once in the list, nor
* may the Account submitting the transaction appear in the list.
*/
SignerEntries: SignerEntry[]
}
const MAX_SIGNERS = 8
const MAX_SIGNERS = 32
const HEX_WALLET_LOCATOR_REGEX = /^[0-9A-Fa-f]{64}$/u
/**
* Verify the form and type of an SignerListSet at runtime.
@@ -61,7 +63,21 @@ export function validateSignerListSet(tx: Record<string, unknown>): void {
if (tx.SignerEntries.length > MAX_SIGNERS) {
throw new ValidationError(
'SignerListSet: maximum of 8 members allowed in SignerEntries',
`SignerListSet: maximum of ${MAX_SIGNERS} members allowed in SignerEntries`,
)
}
if (tx.SignerEntries.length > 0) {
for (const entry of tx.SignerEntries) {
const signerEntry = entry.SignerEntry
if (
signerEntry.WalletLocator !== undefined &&
!HEX_WALLET_LOCATOR_REGEX.test(signerEntry.WalletLocator)
) {
throw new ValidationError(
`SignerListSet: WalletLocator in SignerEntry must be a 256-bit (32-byte) hexadecimal value`,
)
}
}
}
}

View File

@@ -89,4 +89,127 @@ describe('SignerListSet', function () {
'SignerListSet: invalid SignerEntries',
)
})
it(`throws w/ maximum of 32 members allowed in SignerEntries`, function () {
signerListSetTx.SignerEntries = []
const accounts = [
'rBFBipte4nAQCTsRxd2czwvSurhCpAf4X6',
'r3ijUH32iiy9tYNj3rD7hKWYjy1BFUxngm',
'rpwq8vi4Mn3L5kDJmb8Mg59CanPFPzMCnj',
'rB72Gzqfejai46nkA4HaKYBHwAnn2yUoT4',
'rGqsJSAW71pCfUwDD5m52bLw69RzFg6kMW',
'rs8smPRA31Ym4mGxb1wzgwxtU5eVK82Gyk',
'rLrugpGxzezUQLDh7Jv1tZpouuV4MQLbU9',
'rUQ6zLXQdh1jJLGwMXp9P8rgi42kwuafzs',
'rMjY8sPdfxsyRrnVKQcutxr4mTHNXy9dEF',
'rUaxYLeFGm6SmMoa2WCqLKSyHwJyvaQmeG',
'r9wUfeVtqMfqrcDTfCpNYbNZvs5q9M9Rpo',
'rQncVNak5kvJGPUFa6fuKH7t8Usjs7Np1c',
'rnwbSSnPbVbUzuBa4etkeYrfy5v7SyhtPu',
'rDXh5D3t48MdBJyXByXq47k5P8Kuf1758B',
'rh1D4jd2mAiqUPHfAZ2cY9Nbfa3kAkaQXP',
'r9T129tXgtnyfGoLeS35c2HctaZAZSQoCH',
'rUd2uKsyCWfJP7Ve36mKoJbNCA7RYThnYk',
'r326x8PaAFtnaH7uoxaKrcDWuwpeHn4wDa',
'rpN3mkXkYhfNadcXPrY4LniM1KpM3egyQM',
'rsPKbR155hz1zrA4pSJp5Y2fxasZAatcHb',
'rsyWFLaEKTpaoSJusjpcDvGexuHCwMnqss',
'rUbc5RXfyF81oLDMgd3d7jpY9YMNMZG4XN',
'rGpYHM88BZe1iVKFHm5xiWYYxR74oxJEXf',
'rPsetWAtR1KxDtxzgHjRMD7Rc87rvXk5nD',
'rwSeNhL6Hi34igr12mCr61jY42psfTkWTq',
'r46Mygy98qjkDhVB6qs4sBnqaf7FPiA2vU',
'r4s8GmeYN4CiwVate1nMUvwMQbundqf5cW',
'rKAr4dQWDYG8cG2hSwJUVp4ry4WNaWiNgp',
'rPWXRLp1vqeUHEH3WiSKuyo9GM9XhaENQU',
'rPgmdBdRKGmndxNEYxUrrsYCZaS6go9RvW',
'rPDJZ9irzgwKRKScfEmuJMvUgrqZAJNCbL',
'rDuU2uSXMfEaoxN1qW8sj7aUNFLGEn3Hr2',
'rsbjSjA4TCB9gtm7x7SrWbZHB6g4tt9CGU',
]
signerListSetTx.SignerQuorum = accounts.length
for (const acc of accounts) {
signerListSetTx.SignerEntries.push({
SignerEntry: {
Account: acc,
SignerWeight: 1,
},
})
}
const errorMessage =
'SignerListSet: maximum of 32 members allowed in SignerEntries'
assert.throws(
() => validateSignerListSet(signerListSetTx),
ValidationError,
errorMessage,
)
assert.throws(
() => validate(signerListSetTx),
ValidationError,
errorMessage,
)
})
it(`verifies valid WalletLocator in SignerEntries`, function () {
signerListSetTx.SignerQuorum = 3
signerListSetTx.SignerEntries = [
{
SignerEntry: {
Account: 'rBFBipte4nAQCTsRxd2czwvSurhCpAf4X6',
SignerWeight: 1,
WalletLocator:
'CAFECAFECAFECAFECAFECAFECAFECAFECAFECAFECAFECAFECAFECAFECAFECAFE',
},
},
{
SignerEntry: {
Account: 'r3ijUH32iiy9tYNj3rD7hKWYjy1BFUxngm',
SignerWeight: 1,
},
},
{
SignerEntry: {
Account: 'rpwq8vi4Mn3L5kDJmb8Mg59CanPFPzMCnj',
SignerWeight: 1,
WalletLocator:
'00000000000000000000000000000000000000000000000000000000DEADBEEF',
},
},
]
assert.doesNotThrow(() => validateSignerListSet(signerListSetTx))
assert.doesNotThrow(() => validate(signerListSetTx))
})
it(`throws w/ invalid WalletLocator in SignerEntries`, function () {
signerListSetTx.SignerQuorum = 2
signerListSetTx.SignerEntries = [
{
SignerEntry: {
Account: 'rBFBipte4nAQCTsRxd2czwvSurhCpAf4X6',
SignerWeight: 1,
WalletLocator: 'not_valid',
},
},
{
SignerEntry: {
Account: 'r3ijUH32iiy9tYNj3rD7hKWYjy1BFUxngm',
SignerWeight: 1,
},
},
]
const errorMessage =
'SignerListSet: WalletLocator in SignerEntry must be a 256-bit (32-byte) hexadecimal value'
assert.throws(
() => validateSignerListSet(signerListSetTx),
ValidationError,
errorMessage,
)
assert.throws(
() => validate(signerListSetTx),
ValidationError,
errorMessage,
)
})
})