mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-10 07:45:49 +00:00
Compare commits
5 Commits
expanded-s
...
xrpl-codec
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
742b9d0971 | ||
|
|
264a95b028 | ||
|
|
1b02d95ad2 | ||
|
|
234a2156d3 | ||
|
|
aff6988f09 |
@@ -83,6 +83,9 @@ npm run docgen
|
||||
|
||||
This updates `docs/` at the top level, where GitHub Pages looks for the docs.
|
||||
|
||||
## Update `definitions.json`
|
||||
Use [this repo](https://github.com/RichardAH/xrpl-codec-gen) to generate a new `definitions.json` file from the rippled source code. Instructions are available in that README.
|
||||
|
||||
## Adding and removing packages
|
||||
|
||||
`xrpl.js` uses `lerna` and `npm`'s workspaces features to manage a monorepo.
|
||||
|
||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -16704,7 +16704,7 @@
|
||||
}
|
||||
},
|
||||
"packages/ripple-binary-codec": {
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.2",
|
||||
"integrity": "sha512-XMRCbFXyG+dGp3x7tMs9IwA+FVWPPaGjdHYW2+g4Q/WQJqFp5MRED+jjOBOUafmrW4TUsOn1PEEdbB4ozWbDBw==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
@@ -16743,7 +16743,7 @@
|
||||
}
|
||||
},
|
||||
"packages/xrpl": {
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"integrity": "sha512-NmrSYpXym7NzGABeXU1H8g4ZtCxRhr/3wu0lguxzcIYpcKPgWLYimg+s9NLLNbPWTZdxXu9SeSWu5zh4gyqAeA==",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
@@ -16753,7 +16753,7 @@
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"lodash": "^4.17.4",
|
||||
"ripple-address-codec": "^4.2.4",
|
||||
"ripple-binary-codec": "^1.4.1",
|
||||
"ripple-binary-codec": "^1.4.2",
|
||||
"ripple-keypairs": "^1.1.4",
|
||||
"ws": "^8.2.2"
|
||||
},
|
||||
@@ -29425,7 +29425,7 @@
|
||||
"https-proxy-agent": "^5.0.0",
|
||||
"lodash": "^4.17.4",
|
||||
"ripple-address-codec": "^4.2.4",
|
||||
"ripple-binary-codec": "^1.4.1",
|
||||
"ripple-binary-codec": "^1.4.2",
|
||||
"ripple-keypairs": "^1.1.4",
|
||||
"ws": "^8.2.2",
|
||||
"xrpl-local": "file:src"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
# 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)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ripple-binary-codec",
|
||||
"version": "1.4.1",
|
||||
"version": "1.4.2",
|
||||
"description": "XRP Ledger binary codec",
|
||||
"files": [
|
||||
"dist/*",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -483,13 +483,6 @@
|
||||
"type": 5,
|
||||
"expected_hex": "5013"
|
||||
},
|
||||
{
|
||||
"type_name": "Hash256",
|
||||
"name": "TicketID",
|
||||
"nth_of_type": 20,
|
||||
"type": 5,
|
||||
"expected_hex": "5014"
|
||||
},
|
||||
{
|
||||
"type_name": "Hash256",
|
||||
"name": "Digest",
|
||||
@@ -721,13 +714,6 @@
|
||||
"type": 8,
|
||||
"expected_hex": "84"
|
||||
},
|
||||
{
|
||||
"type_name": "AccountID",
|
||||
"name": "Target",
|
||||
"nth_of_type": 7,
|
||||
"type": 8,
|
||||
"expected_hex": "87"
|
||||
},
|
||||
{
|
||||
"type_name": "AccountID",
|
||||
"name": "RegularKey",
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
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)
|
||||
|
||||
2
packages/xrpl/package-lock.json
generated
2
packages/xrpl/package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xrpl",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xrpl",
|
||||
"version": "2.3.0",
|
||||
"version": "2.3.1",
|
||||
"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.1",
|
||||
"ripple-binary-codec": "^1.4.2",
|
||||
"ripple-keypairs": "^1.1.4",
|
||||
"ws": "^8.2.2"
|
||||
},
|
||||
|
||||
@@ -61,31 +61,10 @@ 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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,15 +20,13 @@ 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 32 members. No address may appear more than once in the list, nor
|
||||
* more than 8 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 = 32
|
||||
|
||||
const HEX_WALLET_LOCATOR_REGEX = /^[0-9A-Fa-f]{64}$/u
|
||||
const MAX_SIGNERS = 8
|
||||
|
||||
/**
|
||||
* Verify the form and type of an SignerListSet at runtime.
|
||||
@@ -63,21 +61,7 @@ export function validateSignerListSet(tx: Record<string, unknown>): void {
|
||||
|
||||
if (tx.SignerEntries.length > MAX_SIGNERS) {
|
||||
throw new ValidationError(
|
||||
`SignerListSet: maximum of ${MAX_SIGNERS} members allowed in SignerEntries`,
|
||||
'SignerListSet: maximum of 8 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`,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,127 +89,4 @@ 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,
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user