mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Add unit test for submit
This commit is contained in:
@@ -49,7 +49,7 @@ function computeSignature(txJSON, keypair) {
|
||||
|
||||
/*:: type TxJSON = {Account: string; SigningPubKey: string,
|
||||
TxnSignature: string};
|
||||
type Signed = {tx_blob: string; hash: string}; */
|
||||
type Signed = {signedTransaction: string; id: string}; */
|
||||
function sign(txJSON: TxJSON, secret: string): Signed {
|
||||
validate.txJSON(txJSON);
|
||||
validate.addressAndSecret({address: txJSON.Account, secret: secret});
|
||||
@@ -61,8 +61,8 @@ function sign(txJSON: TxJSON, secret: string): Signed {
|
||||
txJSON.TxnSignature = computeSignature(txJSON, keypair);
|
||||
const serialized = serialize(txJSON);
|
||||
return {
|
||||
tx_blob: serialized.to_hex(),
|
||||
hash: hashSerialization(serialized, HASH_TX_ID)
|
||||
signedTransaction: serialized.to_hex(),
|
||||
id: hashSerialization(serialized, HASH_TX_ID)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ function submit(tx_blob: string, callback: Callback): void {
|
||||
validate.blob(tx_blob);
|
||||
const request = new ripple.Request(this.remote, 'submit');
|
||||
request.message.tx_blob = tx_blob;
|
||||
request.request(callback);
|
||||
request.request(null, callback);
|
||||
}
|
||||
|
||||
module.exports = submit;
|
||||
|
||||
Reference in New Issue
Block a user