register arbitrator dispute agent

This commit is contained in:
woodser 2022-04-26 19:57:29 -04:00
parent e18d0ea2c2
commit df270eab83

View File

@ -125,13 +125,13 @@ const TestConfig = {
direction: "buy", // buy or sell xmr direction: "buy", // buy or sell xmr
amount: BigInt("200000000000"), // amount of xmr to trade amount: BigInt("200000000000"), // amount of xmr to trade
assetCode: "eth", // counter asset to trade assetCode: "eth", // counter asset to trade
price: undefined, // use market price if undefined // TODO: converted to long on backend price: undefined, // use market price if undefined
paymentAccountId: undefined, paymentAccountId: undefined,
priceMargin: 0.0, priceMargin: 0.0,
minAmount: undefined, minAmount: undefined,
buyerSecurityDeposit: 0.15, buyerSecurityDeposit: 0.15,
awaitUnlockedBalance: false, awaitUnlockedBalance: false,
triggerPrice: undefined // TODO: fails if there is a decimal, converted to long on backend triggerPrice: undefined
} }
}; };
@ -191,9 +191,8 @@ beforeAll(async () => {
alice = startupHavenods[1]; alice = startupHavenods[1];
bob = startupHavenods[2]; bob = startupHavenods[2];
// register arbitrator as dispute agents // register arbitrator dispute agent
await arbitrator.registerDisputeAgent("mediator", TestConfig.devPrivilegePrivKey); await arbitrator.registerDisputeAgent("arbitrator", TestConfig.devPrivilegePrivKey);
await arbitrator.registerDisputeAgent("refundagent", TestConfig.devPrivilegePrivKey);
// connect monero clients // connect monero clients
monerod = await monerojs.connectToDaemonRpc(TestConfig.monerod.url, TestConfig.monerod.username, TestConfig.monerod.password); monerod = await monerojs.connectToDaemonRpc(TestConfig.monerod.url, TestConfig.monerod.username, TestConfig.monerod.password);
@ -774,8 +773,9 @@ test("Can get market depth", async () => {
}); });
test("Can register as dispute agents", async () => { test("Can register as dispute agents", async () => {
await arbitrator.registerDisputeAgent("mediator", TestConfig.devPrivilegePrivKey); // TODO: bisq mediator = haveno arbitrator await arbitrator.registerDisputeAgent("arbitrator", TestConfig.devPrivilegePrivKey);
await arbitrator.registerDisputeAgent("refundagent", TestConfig.devPrivilegePrivKey); // TODO: no refund agent in haveno await arbitrator.registerDisputeAgent("mediator", TestConfig.devPrivilegePrivKey);
await arbitrator.registerDisputeAgent("refundagent", TestConfig.devPrivilegePrivKey);
// test bad dispute agent type // test bad dispute agent type
try { try {
@ -787,7 +787,7 @@ test("Can register as dispute agents", async () => {
// test bad key // test bad key
try { try {
await arbitrator.registerDisputeAgent("mediator", "bad key"); await arbitrator.registerDisputeAgent("arbitrator", "bad key");
throw new Error("should have thrown error registering bad key"); throw new Error("should have thrown error registering bad key");
} catch (err) { } catch (err) {
if (err.message !== "invalid registration key") throw new Error("Unexpected error: " + err.message); if (err.message !== "invalid registration key") throw new Error("Unexpected error: " + err.message);
@ -1961,7 +1961,6 @@ async function createCryptoPaymentAccount(trader: HavenoClient, currencyCode = "
throw new Error("No test config for crypto: " + currencyCode); throw new Error("No test config for crypto: " + currencyCode);
} }
// TODO: specify counter currency code
async function postOffer(maker: HavenoClient, config?: PostOfferConfig) { async function postOffer(maker: HavenoClient, config?: PostOfferConfig) {
// assign default options // assign default options