Closed surferwat closed 5 years ago
@surferwat The condition should only include upper case letters, although it's actually just a hexadecimal representation of the data. You should convert the string to uppercase with .toUpperCase()
:
const condition = myFulfillment.getConditionBinary().toString('hex').toUpperCase();
// keep secret until you want to finish executing the held payment:
const fulfillment = myFulfillment.serializeBinary().toString('hex').toUpperCase();
(Aside from prepareEscrowCreation
's validation, ripple-lib's sign
method relies on ripple-binary-codec
, which does not recognize lowercase letters for the hex representation.)
Got it. Thank you.
Hi!
After I send a conditional escrowCreation transaction to the XRP Test Net Faucet via the RippleAPI, I get the following error message: [ValidationError(instance.escrowCreation.condition does not match pattern "^[A-F0-9]{0,256}$")]
It looks like the pattern only accepts upper case letters, but the condition generated using five-bells-conditions includes lower case ones. Should the condition only include upper case letters? Or should the pattern be changed to allow for lower case letters? Thank you.
Additional details:
I am using the Crypto-Conditions library, five-bells-condition to calculate a condition as shown in the code block below which is based off of the example provided here: https://developers.ripple.com/send-a-conditionally-held-escrow.html
The string condition generated and used in defining the escrow is as follows: a025802086f3a3d870e4060905f5cfffc2c6c256e62ce610971bb634bd25f83408b54a60810120