mirror of
https://github.com/haveno-dex/haveno-ts.git
synced 2025-08-02 03:26:24 -04:00
test that offers filtered when reserved funds spent or duplicated
introduce envoy config for running tests with alice and bob test offer removal when reserved output spent using monero-javascript add instructions to run tests in readme update protobuf definitions
This commit is contained in:
parent
3d8e37e646
commit
e35f8c5e95
10 changed files with 647 additions and 50 deletions
|
@ -1,20 +1,50 @@
|
|||
// import haveno types
|
||||
import {HavenoDaemon} from "./HavenoDaemon";
|
||||
import {XmrBalanceInfo, OfferInfo} from './protobuf/grpc_pb';
|
||||
import {XmrBalanceInfo, OfferInfo} from './protobuf/grpc_pb'; // TODO (woodser): better names; haveno_grpc_pb, haveno_pb
|
||||
import {PaymentAccount} from './protobuf/pb_pb';
|
||||
|
||||
const HAVENO_UI_VERSION = "1.6.2";
|
||||
const HAVENO_DAEMON_URL = "http://localhost:8080";
|
||||
const HAVENO_DAEMON_PASSWORD = "apitest";
|
||||
// import monero-javascript
|
||||
const monerojs = require("monero-javascript"); // TODO (woodser): support typescript and `npm install @types/monero-javascript` in monero-javascript
|
||||
const MoneroDaemonRpc = monerojs.MoneroDaemonRpc;
|
||||
const MoneroWalletRpc = monerojs.MoneroWalletRpc;
|
||||
|
||||
const daemon = new HavenoDaemon(HAVENO_DAEMON_URL, HAVENO_DAEMON_PASSWORD);
|
||||
// alice config
|
||||
const havenoVersion = "1.6.2";
|
||||
const aliceDaemonUrl = "http://localhost:8080";
|
||||
const aliceDaemonPassword = "apitest";
|
||||
const alice: HavenoDaemon = new HavenoDaemon(aliceDaemonUrl, aliceDaemonPassword);
|
||||
const aliceWalletUrl = "http://127.0.0.1:51743"; // alice's internal haveno wallet for direct testing // TODO (woodser): make configurable rather than randomly generated
|
||||
const aliceWalletUsername = "rpc_user";
|
||||
const aliceWalletPassword = "abc123";
|
||||
const aliceWallet = new MoneroWalletRpc(aliceWalletUrl, aliceWalletUsername, aliceWalletPassword);
|
||||
const aliceWalletSyncPeriod = 5000;
|
||||
|
||||
test("Can get the version", async () => {
|
||||
let version = await daemon.getVersion();
|
||||
expect(version).toEqual(HAVENO_UI_VERSION);
|
||||
// bob config
|
||||
const bobDaemonUrl = "http://localhost:8081";
|
||||
const bobDaemonPassword = "apitest";
|
||||
const bob: HavenoDaemon = new HavenoDaemon(bobDaemonUrl, bobDaemonPassword);
|
||||
|
||||
// monero daemon config
|
||||
const moneroDaemonUrl = "http://localhost:38081"
|
||||
const moneroDaemonUsername = "superuser";
|
||||
const moneroDaemonPassword = "abctesting123";
|
||||
let monerod: any;
|
||||
|
||||
beforeAll(async () => {
|
||||
await monerojs.LibraryUtils.setWorkerDistPath("./node_modules/monero-javascript/src/main/js/common/MoneroWebWorker.js"); // TODO (woodser): remove this when update to monero-javascript-v0.5.6 which correctly detects node environment
|
||||
monerod = await monerojs.connectToDaemonRpc(moneroDaemonUrl, moneroDaemonUsername, moneroDaemonPassword);
|
||||
//for (let offer of await alice.getMyOffers("BUY")) await alice.removeOffer(offer.getId());
|
||||
//for (let offer of await alice.getMyOffers("SELL")) await alice.removeOffer(offer.getId());
|
||||
//for (let frozenOutput of await aliceWallet.getOutputs({isFrozen: true})) await aliceWallet.thawOutput(frozenOutput.getKeyImage().getHex());
|
||||
});
|
||||
|
||||
test("Can get the user's balances", async () => {
|
||||
let balances: XmrBalanceInfo = await daemon.getBalances();
|
||||
test("Can get the version", async () => {
|
||||
let version = await alice.getVersion();
|
||||
expect(version).toEqual(havenoVersion);
|
||||
});
|
||||
|
||||
test("Can get balances", async () => {
|
||||
let balances: XmrBalanceInfo = await alice.getBalances();
|
||||
expect(balances.getUnlockedBalance());
|
||||
expect(balances.getLockedBalance());
|
||||
expect(balances.getReservedOfferBalance());
|
||||
|
@ -22,28 +52,28 @@ test("Can get the user's balances", async () => {
|
|||
});
|
||||
|
||||
test("Can get offers", async () => {
|
||||
let offers: OfferInfo[] = await daemon.getOffers("BUY");
|
||||
let offers: OfferInfo[] = await alice.getOffers("BUY");
|
||||
for (let offer of offers) {
|
||||
testOffer(offer);
|
||||
}
|
||||
});
|
||||
|
||||
test("Can get the user's created offers", async () => {
|
||||
let offers: OfferInfo[] = await daemon.getMyOffers("SELL");
|
||||
test("Can get my offers", async () => {
|
||||
let offers: OfferInfo[] = await alice.getMyOffers("SELL");
|
||||
for (let offer of offers) {
|
||||
testOffer(offer);
|
||||
}
|
||||
});
|
||||
|
||||
test("Can get payment accounts", async () => {
|
||||
let paymentAccounts: PaymentAccount[] = await daemon.getPaymentAccounts();
|
||||
let paymentAccounts: PaymentAccount[] = await alice.getPaymentAccounts();
|
||||
for (let paymentAccount of paymentAccounts) {
|
||||
testPaymentAccount(paymentAccount);
|
||||
}
|
||||
});
|
||||
|
||||
test("Can create crypto payment account", async () => {
|
||||
let ethPaymentAccount: PaymentAccount = await daemon.createCryptoPaymentAccount(
|
||||
test("Can create a crypto payment account", async () => {
|
||||
let ethPaymentAccount: PaymentAccount = await alice.createCryptoPaymentAccount(
|
||||
"my eth account",
|
||||
"eth",
|
||||
"0xdBdAb835Acd6fC84cF5F9aDD3c0B5a1E25fbd99f",
|
||||
|
@ -52,10 +82,89 @@ test("Can create crypto payment account", async () => {
|
|||
});
|
||||
|
||||
test("Can post and remove an offer", async () => {
|
||||
|
||||
// get unlocked balance before reserving funds for offer
|
||||
let unlockedBalanceBefore: bigint = BigInt((await alice.getBalances()).getUnlockedBalance());
|
||||
|
||||
// post offer
|
||||
let offer: OfferInfo = await postOffer();
|
||||
|
||||
// cancel offer
|
||||
await alice.removeOffer(offer.getId());
|
||||
|
||||
// offer is removed from my offers
|
||||
if (getOffer(await alice.getMyOffers("buy"), offer.getId())) throw new Error("Offer " + offer.getId() + " was found in my offers after removal");
|
||||
|
||||
// reserved balance released
|
||||
expect(unlockedBalanceBefore).toEqual(BigInt((await alice.getBalances()).getUnlockedBalance()));
|
||||
});
|
||||
|
||||
jest.setTimeout(15000);
|
||||
test("Invalidates offers when reserved funds are spent", async () => {
|
||||
|
||||
// get frozen key images before posting offer
|
||||
let frozenKeyImagesBefore = [];
|
||||
for (let frozenOutput of await aliceWallet.getOutputs({isFrozen: true})) frozenKeyImagesBefore.push(frozenOutput.getKeyImage().getHex());
|
||||
|
||||
// post offer
|
||||
await wait(1000);
|
||||
let offer: OfferInfo = await postOffer();
|
||||
|
||||
// get key images reserved by offer
|
||||
let reservedKeyImages = [];
|
||||
let frozenKeyImagesAfter = [];
|
||||
for (let frozenOutput of await aliceWallet.getOutputs({isFrozen: true})) frozenKeyImagesAfter.push(frozenOutput.getKeyImage().getHex());
|
||||
for (let frozenKeyImageAfter of frozenKeyImagesAfter) {
|
||||
if (!frozenKeyImagesBefore.includes(frozenKeyImageAfter)) reservedKeyImages.push(frozenKeyImageAfter);
|
||||
}
|
||||
|
||||
// offer is available to peers
|
||||
await wait(3000);
|
||||
if (!getOffer(await bob.getOffers("buy"), offer.getId())) throw new Error("Offer " + offer.getId() + " was not found in peer's offers after posting");
|
||||
|
||||
// spend one of offer's reserved outputs
|
||||
if (!reservedKeyImages.length) throw new Error("No reserved key images detected");
|
||||
await aliceWallet.thawOutput(reservedKeyImages[0]);
|
||||
let tx = await aliceWallet.sweepOutput({keyImage: reservedKeyImages[0], address: await aliceWallet.getPrimaryAddress(), relay: false});
|
||||
await monerod.submitTxHex(tx.getFullHex(), true);
|
||||
|
||||
// wait for spend to be seen
|
||||
await wait(aliceWalletSyncPeriod * 2); // TODO (woodser): need place for common test utilities
|
||||
|
||||
// offer is removed from peer offers
|
||||
if (getOffer(await bob.getOffers("buy"), offer.getId())) throw new Error("Offer " + offer.getId() + " was found in peer's offers after reserved funds spent");
|
||||
|
||||
// offer is removed from my offers
|
||||
if (getOffer(await alice.getMyOffers("buy"), offer.getId())) throw new Error("Offer " + offer.getId() + " was found in my offers after reserved funds spent");
|
||||
|
||||
// offer is automatically cancelled
|
||||
try {
|
||||
await alice.removeOffer(offer.getId());
|
||||
throw new Error("cannot remove invalidated offer");
|
||||
} catch (err) {
|
||||
if (err.message === "cannot remove invalidated offer") throw new Error(err.message);
|
||||
}
|
||||
|
||||
// flush tx from pool
|
||||
await monerod.flushTxPool(tx.getHash());
|
||||
});
|
||||
|
||||
test("Can complete a trade", async () => {
|
||||
|
||||
// wait for alice and bob to have unlocked balance for trade
|
||||
let tradeAmount: bigint = BigInt("250000000000");
|
||||
await waitForUnlockedBalance(tradeAmount, alice, bob);
|
||||
|
||||
// TODO: finish this test
|
||||
});
|
||||
|
||||
// ------------------------------- HELPERS ------------------------------------
|
||||
|
||||
async function postOffer() {
|
||||
|
||||
// test requires ethereum payment account
|
||||
let ethPaymentAccount: PaymentAccount | undefined;
|
||||
for (let paymentAccount of await daemon.getPaymentAccounts()) {
|
||||
for (let paymentAccount of await alice.getPaymentAccounts()) {
|
||||
if (paymentAccount.getSelectedTradeCurrency()?.getCode() === "ETH") {
|
||||
ethPaymentAccount = paymentAccount;
|
||||
break;
|
||||
|
@ -64,9 +173,10 @@ test("Can post and remove an offer", async () => {
|
|||
if (!ethPaymentAccount) throw new Error("Test requires ethereum payment account to post offer");
|
||||
|
||||
// get unlocked balance before reserving offer
|
||||
let unlockedBalanceBefore: bigint = BigInt((await daemon.getBalances()).getUnlockedBalance());
|
||||
let unlockedBalanceBefore: bigint = BigInt((await alice.getBalances()).getUnlockedBalance());
|
||||
|
||||
// post offer
|
||||
// TODO: don't define variables, just document in comments
|
||||
let amount: bigint = BigInt("250000000000");
|
||||
let minAmount: bigint = BigInt("150000000000");
|
||||
let price: number = 12.378981; // TODO: price is optional? price string gets converted to long?
|
||||
|
@ -75,7 +185,7 @@ test("Can post and remove an offer", async () => {
|
|||
let buyerSecurityDeposit: number = 0.15; // 15%
|
||||
let triggerPrice: number = 12; // TODO: fails if there is decimal, gets converted to long?
|
||||
let paymentAccountId: string = ethPaymentAccount.getId();
|
||||
let offer: OfferInfo = await daemon.postOffer("eth",
|
||||
let offer: OfferInfo = await alice.postOffer("eth",
|
||||
"buy", // buy xmr for eth
|
||||
price,
|
||||
useMarketBasedPrice,
|
||||
|
@ -88,24 +198,19 @@ test("Can post and remove an offer", async () => {
|
|||
testOffer(offer);
|
||||
|
||||
// unlocked balance has decreased
|
||||
let unlockedBalanceAfter: bigint = BigInt((await daemon.getBalances()).getUnlockedBalance());
|
||||
let unlockedBalanceAfter: bigint = BigInt((await alice.getBalances()).getUnlockedBalance());
|
||||
expect(unlockedBalanceAfter).toBeLessThan(unlockedBalanceBefore);
|
||||
|
||||
// offer is included in my offers only
|
||||
if (!getOffer(await daemon.getMyOffers("buy"), offer.getId())) throw new Error("Offer " + offer.getId() + " was not found in my offers");
|
||||
if (getOffer(await daemon.getOffers("buy"), offer.getId())) throw new Error("My offer " + offer.getId() + " should not appear in available offers");
|
||||
if (!getOffer(await alice.getMyOffers("buy"), offer.getId())) throw new Error("Offer " + offer.getId() + " was not found in my offers");
|
||||
if (getOffer(await alice.getOffers("buy"), offer.getId())) throw new Error("My offer " + offer.getId() + " should not appear in available offers");
|
||||
|
||||
// cancel the offer
|
||||
await daemon.cancelOffer(offer.getId());
|
||||
|
||||
// offer is removed from my offers
|
||||
if (getOffer(await daemon.getOffers("buy"), offer.getId())) throw new Error("Offer " + offer.getId() + " was found in my offers after removal");
|
||||
|
||||
// reserved balance restored
|
||||
expect(unlockedBalanceBefore).toEqual(BigInt((await daemon.getBalances()).getUnlockedBalance()));
|
||||
});
|
||||
return offer;
|
||||
}
|
||||
|
||||
// ------------------------------- HELPERS ------------------------------------
|
||||
async function waitForUnlockedBalance(amount: bigint, ...clients: HavenoDaemon[]) {
|
||||
throw new Error("waitForUnlockedFunds() not implemented"); // TODO: implement
|
||||
}
|
||||
|
||||
function getOffer(offers: OfferInfo[], id: string): OfferInfo | undefined {
|
||||
return offers.find(offer => offer.getId() === id);
|
||||
|
@ -113,10 +218,14 @@ function getOffer(offers: OfferInfo[], id: string): OfferInfo | undefined {
|
|||
|
||||
function testPaymentAccount(paymentAccount: PaymentAccount) {
|
||||
expect(paymentAccount.getId()).toHaveLength;
|
||||
// TODO: test rest of offer
|
||||
// TODO: test rest of payment account
|
||||
}
|
||||
|
||||
function testOffer(offer: OfferInfo) {
|
||||
expect(offer.getId()).toHaveLength;
|
||||
// TODO: test rest of offer
|
||||
}
|
||||
|
||||
async function wait(durationMs: number) {
|
||||
return new Promise(function(resolve) { setTimeout(resolve, durationMs); });
|
||||
}
|
|
@ -192,11 +192,11 @@ class HavenoDaemon {
|
|||
}
|
||||
|
||||
/**
|
||||
* Remove a posted offer, unreserving its funds.
|
||||
* Remove a posted offer, releasing its reserved funds.
|
||||
*
|
||||
* @param {string} id - the offer id to cancel
|
||||
*/
|
||||
async cancelOffer(id: string): Promise<void> {
|
||||
async removeOffer(id: string): Promise<void> {
|
||||
let that = this;
|
||||
return new Promise(function(resolve, reject) {
|
||||
that._offersClient.cancelOffer(new CancelOfferRequest().setId(id), {password: that._password}, function(err: grpcWeb.Error) {
|
||||
|
|
12
src/protobuf/pb_pb.d.ts
vendored
12
src/protobuf/pb_pb.d.ts
vendored
|
@ -788,6 +788,11 @@ export class SignOfferRequest extends jspb.Message {
|
|||
getReserveTxKey(): string;
|
||||
setReserveTxKey(value: string): SignOfferRequest;
|
||||
|
||||
getReserveTxKeyImagesList(): Array<string>;
|
||||
setReserveTxKeyImagesList(value: Array<string>): SignOfferRequest;
|
||||
clearReserveTxKeyImagesList(): SignOfferRequest;
|
||||
addReserveTxKeyImages(value: string, index?: number): SignOfferRequest;
|
||||
|
||||
getPayoutAddress(): string;
|
||||
setPayoutAddress(value: string): SignOfferRequest;
|
||||
|
||||
|
@ -811,6 +816,7 @@ export namespace SignOfferRequest {
|
|||
reserveTxHash: string,
|
||||
reserveTxHex: string,
|
||||
reserveTxKey: string,
|
||||
reserveTxKeyImagesList: Array<string>,
|
||||
payoutAddress: string,
|
||||
}
|
||||
}
|
||||
|
@ -4138,6 +4144,11 @@ export class OfferPayload extends jspb.Message {
|
|||
getArbitratorSignature(): string;
|
||||
setArbitratorSignature(value: string): OfferPayload;
|
||||
|
||||
getReserveTxKeyImagesList(): Array<string>;
|
||||
setReserveTxKeyImagesList(value: Array<string>): OfferPayload;
|
||||
clearReserveTxKeyImagesList(): OfferPayload;
|
||||
addReserveTxKeyImages(value: string, index?: number): OfferPayload;
|
||||
|
||||
serializeBinary(): Uint8Array;
|
||||
toObject(includeInstance?: boolean): OfferPayload.AsObject;
|
||||
static toObject(includeInstance: boolean, msg: OfferPayload): OfferPayload.AsObject;
|
||||
|
@ -4186,6 +4197,7 @@ export namespace OfferPayload {
|
|||
protocolVersion: number,
|
||||
arbitratorNodeAddress?: NodeAddress.AsObject,
|
||||
arbitratorSignature: string,
|
||||
reserveTxKeyImagesList: Array<string>,
|
||||
}
|
||||
|
||||
export enum Direction {
|
||||
|
|
|
@ -537,7 +537,7 @@ if (goog.DEBUG && !COMPILED) {
|
|||
* @constructor
|
||||
*/
|
||||
proto.io.bisq.protobuffer.SignOfferRequest = function(opt_data) {
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
|
||||
jspb.Message.initialize(this, opt_data, 0, -1, proto.io.bisq.protobuffer.SignOfferRequest.repeatedFields_, null);
|
||||
};
|
||||
goog.inherits(proto.io.bisq.protobuffer.SignOfferRequest, jspb.Message);
|
||||
if (goog.DEBUG && !COMPILED) {
|
||||
|
@ -11148,6 +11148,13 @@ proto.io.bisq.protobuffer.GetInventoryResponse.prototype.clearInventoryMap = fun
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* List of repeated fields within this message type.
|
||||
* @private {!Array<number>}
|
||||
* @const
|
||||
*/
|
||||
proto.io.bisq.protobuffer.SignOfferRequest.repeatedFields_ = [11];
|
||||
|
||||
|
||||
|
||||
if (jspb.Message.GENERATE_TO_OBJECT) {
|
||||
|
@ -11189,7 +11196,8 @@ proto.io.bisq.protobuffer.SignOfferRequest.toObject = function(includeInstance,
|
|||
reserveTxHash: jspb.Message.getFieldWithDefault(msg, 8, ""),
|
||||
reserveTxHex: jspb.Message.getFieldWithDefault(msg, 9, ""),
|
||||
reserveTxKey: jspb.Message.getFieldWithDefault(msg, 10, ""),
|
||||
payoutAddress: jspb.Message.getFieldWithDefault(msg, 11, "")
|
||||
reserveTxKeyImagesList: (f = jspb.Message.getRepeatedField(msg, 11)) == null ? undefined : f,
|
||||
payoutAddress: jspb.Message.getFieldWithDefault(msg, 12, "")
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
|
@ -11270,6 +11278,10 @@ proto.io.bisq.protobuffer.SignOfferRequest.deserializeBinaryFromReader = functio
|
|||
msg.setReserveTxKey(value);
|
||||
break;
|
||||
case 11:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.addReserveTxKeyImages(value);
|
||||
break;
|
||||
case 12:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setPayoutAddress(value);
|
||||
break;
|
||||
|
@ -11375,10 +11387,17 @@ proto.io.bisq.protobuffer.SignOfferRequest.serializeBinaryToWriter = function(me
|
|||
f
|
||||
);
|
||||
}
|
||||
f = message.getReserveTxKeyImagesList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedString(
|
||||
11,
|
||||
f
|
||||
);
|
||||
}
|
||||
f = message.getPayoutAddress();
|
||||
if (f.length > 0) {
|
||||
writer.writeString(
|
||||
11,
|
||||
12,
|
||||
f
|
||||
);
|
||||
}
|
||||
|
@ -11623,11 +11642,48 @@ proto.io.bisq.protobuffer.SignOfferRequest.prototype.setReserveTxKey = function(
|
|||
|
||||
|
||||
/**
|
||||
* optional string payout_address = 11;
|
||||
* repeated string reserve_tx_key_images = 11;
|
||||
* @return {!Array<string>}
|
||||
*/
|
||||
proto.io.bisq.protobuffer.SignOfferRequest.prototype.getReserveTxKeyImagesList = function() {
|
||||
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 11));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<string>} value
|
||||
* @return {!proto.io.bisq.protobuffer.SignOfferRequest} returns this
|
||||
*/
|
||||
proto.io.bisq.protobuffer.SignOfferRequest.prototype.setReserveTxKeyImagesList = function(value) {
|
||||
return jspb.Message.setField(this, 11, value || []);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.io.bisq.protobuffer.SignOfferRequest} returns this
|
||||
*/
|
||||
proto.io.bisq.protobuffer.SignOfferRequest.prototype.addReserveTxKeyImages = function(value, opt_index) {
|
||||
return jspb.Message.addToRepeatedField(this, 11, value, opt_index);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the list making it empty but non-null.
|
||||
* @return {!proto.io.bisq.protobuffer.SignOfferRequest} returns this
|
||||
*/
|
||||
proto.io.bisq.protobuffer.SignOfferRequest.prototype.clearReserveTxKeyImagesList = function() {
|
||||
return this.setReserveTxKeyImagesList([]);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* optional string payout_address = 12;
|
||||
* @return {string}
|
||||
*/
|
||||
proto.io.bisq.protobuffer.SignOfferRequest.prototype.getPayoutAddress = function() {
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 11, ""));
|
||||
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 12, ""));
|
||||
};
|
||||
|
||||
|
||||
|
@ -11636,7 +11692,7 @@ proto.io.bisq.protobuffer.SignOfferRequest.prototype.getPayoutAddress = function
|
|||
* @return {!proto.io.bisq.protobuffer.SignOfferRequest} returns this
|
||||
*/
|
||||
proto.io.bisq.protobuffer.SignOfferRequest.prototype.setPayoutAddress = function(value) {
|
||||
return jspb.Message.setProto3StringField(this, 11, value);
|
||||
return jspb.Message.setProto3StringField(this, 12, value);
|
||||
};
|
||||
|
||||
|
||||
|
@ -36401,7 +36457,7 @@ proto.io.bisq.protobuffer.MailboxStoragePayload.prototype.clearExtraDataMap = fu
|
|||
* @private {!Array<number>}
|
||||
* @const
|
||||
*/
|
||||
proto.io.bisq.protobuffer.OfferPayload.repeatedFields_ = [17,19];
|
||||
proto.io.bisq.protobuffer.OfferPayload.repeatedFields_ = [17,19,1003];
|
||||
|
||||
|
||||
|
||||
|
@ -36471,7 +36527,8 @@ proto.io.bisq.protobuffer.OfferPayload.toObject = function(includeInstance, msg)
|
|||
extraDataMap: (f = msg.getExtraDataMap()) ? f.toObject(includeInstance, undefined) : [],
|
||||
protocolVersion: jspb.Message.getFieldWithDefault(msg, 36, 0),
|
||||
arbitratorNodeAddress: (f = msg.getArbitratorNodeAddress()) && proto.io.bisq.protobuffer.NodeAddress.toObject(includeInstance, f),
|
||||
arbitratorSignature: jspb.Message.getFieldWithDefault(msg, 1002, "")
|
||||
arbitratorSignature: jspb.Message.getFieldWithDefault(msg, 1002, ""),
|
||||
reserveTxKeyImagesList: (f = jspb.Message.getRepeatedField(msg, 1003)) == null ? undefined : f
|
||||
};
|
||||
|
||||
if (includeInstance) {
|
||||
|
@ -36665,6 +36722,10 @@ proto.io.bisq.protobuffer.OfferPayload.deserializeBinaryFromReader = function(ms
|
|||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.setArbitratorSignature(value);
|
||||
break;
|
||||
case 1003:
|
||||
var value = /** @type {string} */ (reader.readString());
|
||||
msg.addReserveTxKeyImages(value);
|
||||
break;
|
||||
default:
|
||||
reader.skipField();
|
||||
break;
|
||||
|
@ -36960,6 +37021,13 @@ proto.io.bisq.protobuffer.OfferPayload.serializeBinaryToWriter = function(messag
|
|||
f
|
||||
);
|
||||
}
|
||||
f = message.getReserveTxKeyImagesList();
|
||||
if (f.length > 0) {
|
||||
writer.writeRepeatedString(
|
||||
1003,
|
||||
f
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
@ -37755,6 +37823,43 @@ proto.io.bisq.protobuffer.OfferPayload.prototype.setArbitratorSignature = functi
|
|||
};
|
||||
|
||||
|
||||
/**
|
||||
* repeated string reserve_tx_key_images = 1003;
|
||||
* @return {!Array<string>}
|
||||
*/
|
||||
proto.io.bisq.protobuffer.OfferPayload.prototype.getReserveTxKeyImagesList = function() {
|
||||
return /** @type {!Array<string>} */ (jspb.Message.getRepeatedField(this, 1003));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {!Array<string>} value
|
||||
* @return {!proto.io.bisq.protobuffer.OfferPayload} returns this
|
||||
*/
|
||||
proto.io.bisq.protobuffer.OfferPayload.prototype.setReserveTxKeyImagesList = function(value) {
|
||||
return jspb.Message.setField(this, 1003, value || []);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} value
|
||||
* @param {number=} opt_index
|
||||
* @return {!proto.io.bisq.protobuffer.OfferPayload} returns this
|
||||
*/
|
||||
proto.io.bisq.protobuffer.OfferPayload.prototype.addReserveTxKeyImages = function(value, opt_index) {
|
||||
return jspb.Message.addToRepeatedField(this, 1003, value, opt_index);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Clears the list making it empty but non-null.
|
||||
* @return {!proto.io.bisq.protobuffer.OfferPayload} returns this
|
||||
*/
|
||||
proto.io.bisq.protobuffer.OfferPayload.prototype.clearReserveTxKeyImagesList = function() {
|
||||
return this.setReserveTxKeyImagesList([]);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue