Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Sep 11, 2023
1 parent ac423e3 commit c88b625
Show file tree
Hide file tree
Showing 12 changed files with 640 additions and 640 deletions.
2 changes: 1 addition & 1 deletion test/integration/apiary.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ describe("tests the /accounts endpoint", function () {
.then((resp) => {
// find the pool share balance(s)
const poolShares = resp.balances.filter(
(b) => b.asset_type === "liquidity_pool_shares"
(b) => b.asset_type === "liquidity_pool_shares",
);

expect(poolShares).to.have.lengthOf(1);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/call_builders_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("CallBuilder functions", function () {

expect(arg.toString()).not.to.be.equal("https://onedom.ain/one_segment"); // https://onedom.ain/
expect(builder.url.toString()).to.be.equal(
"https://onedom.ain/one_segment"
"https://onedom.ain/one_segment",
);
});
});
86 changes: 43 additions & 43 deletions test/unit/federation_server_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ describe("federation-server.js tests", function () {
beforeEach(function () {
this.server = new StellarSdk.FederationServer(
"https://acme.com:1337/federation",
"stellar.org"
"stellar.org",
);

this.axiosMock = sinon.mock(axios);
Expand All @@ -21,8 +21,8 @@ describe("federation-server.js tests", function () {
() =>
new StellarSdk.FederationServer(
"http://acme.com:1337/federation",
"stellar.org"
)
"stellar.org",
),
).to.throw(/Cannot connect to insecure federation server/);
});

Expand All @@ -32,8 +32,8 @@ describe("federation-server.js tests", function () {
new StellarSdk.FederationServer(
"http://acme.com:1337/federation",
"stellar.org",
{ allowHttp: true }
)
{ allowHttp: true },
),
).to.not.throw();
});

Expand All @@ -44,8 +44,8 @@ describe("federation-server.js tests", function () {
new StellarSdk.FederationServer(
"http://acme.com:1337/federation",
"stellar.org",
{ allowHttp: true }
)
{ allowHttp: true },
),
).to.not.throw();
});
});
Expand All @@ -56,8 +56,8 @@ describe("federation-server.js tests", function () {
.expects("get")
.withArgs(
sinon.match(
"https://acme.com:1337/federation?type=name&q=bob%2Astellar.org"
)
"https://acme.com:1337/federation?type=name&q=bob%2Astellar.org",
),
)
.returns(
Promise.resolve({
Expand All @@ -66,7 +66,7 @@ describe("federation-server.js tests", function () {
account_id:
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS",
},
})
}),
);
});

Expand All @@ -76,7 +76,7 @@ describe("federation-server.js tests", function () {
.then((response) => {
expect(response.stellar_address).equals("bob*stellar.org");
expect(response.account_id).equals(
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS"
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS",
);
done();
})
Expand All @@ -91,7 +91,7 @@ describe("federation-server.js tests", function () {
.then((response) => {
expect(response.stellar_address).equals("bob*stellar.org");
expect(response.account_id).equals(
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS"
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS",
);
done();
})
Expand All @@ -107,8 +107,8 @@ describe("federation-server.js tests", function () {
.expects("get")
.withArgs(
sinon.match(
"https://acme.com:1337/federation?type=id&q=GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS"
)
"https://acme.com:1337/federation?type=id&q=GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS",
),
)
.returns(
Promise.resolve({
Expand All @@ -117,19 +117,19 @@ describe("federation-server.js tests", function () {
account_id:
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS",
},
})
}),
);
});

it("requests is correct", function (done) {
this.server
.resolveAccountId(
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS"
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS",
)
.then((response) => {
expect(response.stellar_address).equals("bob*stellar.org");
expect(response.account_id).equals(
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS"
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS",
);
done();
})
Expand All @@ -145,8 +145,8 @@ describe("federation-server.js tests", function () {
.expects("get")
.withArgs(
sinon.match(
"https://acme.com:1337/federation?type=txid&q=3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889"
)
"https://acme.com:1337/federation?type=txid&q=3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889",
),
)
.returns(
Promise.resolve({
Expand All @@ -155,19 +155,19 @@ describe("federation-server.js tests", function () {
account_id:
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS",
},
})
}),
);
});

it("requests is correct", function (done) {
this.server
.resolveTransactionId(
"3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889"
"3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889",
)
.then((response) => {
expect(response.stellar_address).equals("bob*stellar.org");
expect(response.account_id).equals(
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS"
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS",
);
done();
})
Expand All @@ -189,19 +189,19 @@ describe("federation-server.js tests", function () {
# for users on your domain.
FEDERATION_SERVER="https://api.stellar.org/federation"
`,
})
}),
);

StellarSdk.FederationServer.createForDomain("acme.com").then(
(federationServer) => {
expect(federationServer.serverURL.protocol()).equals("https");
expect(federationServer.serverURL.hostname()).equals(
"api.stellar.org"
"api.stellar.org",
);
expect(federationServer.serverURL.path()).equals("/federation");
expect(federationServer.domain).equals("acme.com");
done();
}
},
);
});

Expand All @@ -212,12 +212,12 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
.returns(
Promise.resolve({
data: "",
})
}),
);

StellarSdk.FederationServer.createForDomain("acme.com")
.should.be.rejectedWith(
/stellar.toml does not contain FEDERATION_SERVER field/
/stellar.toml does not contain FEDERATION_SERVER field/,
)
.and.notify(done);
});
Expand All @@ -226,7 +226,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
describe("FederationServer.resolve", function () {
it("succeeds for a valid account ID", function (done) {
StellarSdk.FederationServer.resolve(
"GAFSZ3VPBC2H2DVKCEWLN3PQWZW6BVDMFROWJUDAJ3KWSOKQIJ4R5W4J"
"GAFSZ3VPBC2H2DVKCEWLN3PQWZW6BVDMFROWJUDAJ3KWSOKQIJ4R5W4J",
)
.should.eventually.deep.equal({
account_id:
Expand All @@ -252,15 +252,15 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
# for users on your domain.
FEDERATION_SERVER="https://api.stellar.org/federation"
`,
})
}),
);

this.axiosMock
.expects("get")
.withArgs(
sinon.match(
"https://api.stellar.org/federation?type=name&q=bob%2Astellar.org"
)
"https://api.stellar.org/federation?type=name&q=bob%2Astellar.org",
),
)
.returns(
Promise.resolve({
Expand All @@ -271,7 +271,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
memo_type: "id",
memo: "100",
},
})
}),
);

StellarSdk.FederationServer.resolve("bob*stellar.org")
Expand All @@ -296,8 +296,8 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
.expects("get")
.withArgs(
sinon.match(
"https://acme.com:1337/federation?type=name&q=bob%2Astellar.org"
)
"https://acme.com:1337/federation?type=name&q=bob%2Astellar.org",
),
)
.returns(
Promise.resolve({
Expand All @@ -308,7 +308,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
memo_type: "id",
memo: 100,
},
})
}),
);

this.server
Expand All @@ -323,7 +323,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
return done();
}
var response = Array(StellarSdk.FEDERATION_RESPONSE_MAX_SIZE + 10).join(
"a"
"a",
);
let tempServer = http
.createServer((req, res) => {
Expand All @@ -334,11 +334,11 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
new StellarSdk.FederationServer(
"http://localhost:4444/federation",
"stellar.org",
{ allowHttp: true }
{ allowHttp: true },
)
.resolveAddress("bob*stellar.org")
.should.be.rejectedWith(
/federation response exceeds allowed size of [0-9]+/
/federation response exceeds allowed size of [0-9]+/,
)
.notify(done)
.then(() => tempServer.close());
Expand Down Expand Up @@ -376,7 +376,7 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
new StellarSdk.FederationServer(
"http://localhost:4444/federation",
"stellar.org",
opts
opts,
)
.resolveAddress("bob*stellar.org")
.should.be.rejectedWith(/timeout of 1000ms exceeded/)
Expand All @@ -398,10 +398,10 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
new StellarSdk.FederationServer(
"http://localhost:4444/federation",
"stellar.org",
opts
opts,
)
.resolveAccountId(
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS"
"GB5XVAABEQMY63WTHDQ5RXADGYF345VWMNPTN2GFUDZT57D57ZQTJ7PS",
)
.should.be.rejectedWith(/timeout of 1000ms exceeded/)
.notify(done)
Expand All @@ -422,10 +422,10 @@ FEDERATION_SERVER="https://api.stellar.org/federation"
new StellarSdk.FederationServer(
"http://localhost:4444/federation",
"stellar.org",
opts
opts,
)
.resolveTransactionId(
"3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889"
"3389e9f0f1a65f19736cacf544c2e825313e8447f569233bb8db39aa607c8889",
)
.should.be.rejectedWith(/timeout of 1000ms exceeded/)
.notify(done)
Expand Down
14 changes: 7 additions & 7 deletions test/unit/horizon_path_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe("horizon path tests", function () {
.call()
.should.eventually.deep.equal(randomResult.data)
.notify(done);
}
},
);

it("server.transactions() " + serverUrl, function (done) {
Expand All @@ -69,7 +69,7 @@ describe("horizon path tests", function () {
.call()
.should.eventually.deep.equal(randomResult.data)
.notify(done);
}
},
);

it("server.operations().includeFailed(true) " + serverUrl, function (done) {
Expand All @@ -92,7 +92,7 @@ describe("horizon path tests", function () {
.call()
.should.eventually.deep.equal(randomResult.data)
.notify(done);
}
},
);

it(
Expand All @@ -105,7 +105,7 @@ describe("horizon path tests", function () {
.call()
.should.eventually.deep.equal(randomResult.data)
.notify(done);
}
},
);

it("server.submitTransaction() " + serverUrl, function (done) {
Expand All @@ -114,7 +114,7 @@ describe("horizon path tests", function () {
let keypair = StellarSdk.Keypair.random();
let account = new StellarSdk.Account(
keypair.publicKey(),
"56199647068161"
"56199647068161",
);

let fakeTransaction = new StellarSdk.TransactionBuilder(account, {
Expand All @@ -126,13 +126,13 @@ describe("horizon path tests", function () {
destination: keypair.publicKey(),
asset: StellarSdk.Asset.native(),
amount: "100.50",
})
}),
)
.setTimeout(StellarSdk.TimeoutInfinite)
.build();
fakeTransaction.sign(keypair);
let tx = encodeURIComponent(
fakeTransaction.toEnvelope().toXDR().toString("base64")
fakeTransaction.toEnvelope().toXDR().toString("base64"),
);

this.axiosMock
Expand Down
Loading

0 comments on commit c88b625

Please sign in to comment.