Skip to content

Commit

Permalink
chore: apply peer-review suggestion.
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitdevos committed Apr 5, 2024
1 parent c0c4f38 commit 2c49215
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@logion/rest-api-core",
"version": "0.4.8-1",
"version": "0.4.8-2",
"repository": {
"type": "git",
"url": "git+https://github.com/logion-network/logion-rest-api-core.git"
Expand Down
4 changes: 2 additions & 2 deletions src/TestApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { AuthenticationService } from "./AuthenticationService.js";
import { UnauthorizedException } from "dinoloop/modules/builtin/exceptions/exceptions.js";
import { buildBaseExpress } from "./Express.js";

export const ALICE = "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY";
export const BOB = "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty";
export const ALICE = "vQx5kESPn8dWyX4KxMCKqUyCaWUwtui1isX6PVNcZh2Ghjitr";
export const BOB = "vQvWaxNDdzuX5N3qSvGMtjdHcQdw1TAcPNgx4S1Utd3MTxYeN";

export * from "./TestUtil.js";

Expand Down
16 changes: 8 additions & 8 deletions test/AuthenticationController.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,13 @@ function mockDependenciesForAuth(container: Container, verifies: boolean, sessio
if(verifies) {
const signatures: SessionSignature[] = [
{
address: validAccountId(ALICE).address,
address: ALICE,
signature: "SIG_ALICE",
signedOn: requireDefined(DateTime.now().toISO()),
type: "POLKADOT",
},
{
address: validAccountId(BOB).address,
address: BOB,
signature: "SIG_BOB",
signedOn: requireDefined(DateTime.now().toISO()),
type: "POLKADOT",
Expand All @@ -256,13 +256,13 @@ function mockDependenciesForAuth(container: Container, verifies: boolean, sessio
const tokens: Token[] = [
{
type: "Polkadot",
address: validAccountId(ALICE).address,
address: ALICE,
value: TOKEN_ALICE,
expiredOn: DateTime.now(),
},
{
type: "Polkadot",
address: validAccountId(BOB).address,
address: BOB,
value: TOKEN_BOB,
expiredOn: DateTime.now(),
}
Expand All @@ -278,23 +278,23 @@ function mockDependenciesForAuth(container: Container, verifies: boolean, sessio
const sessionRepository = new Mock<SessionRepository>();
if (sessionExists) {
sessionRepository.setup(instance => instance.find(
It.Is<ValidAccountId>(accountId => accountId.address === validAccountId(ALICE).address && accountId.type === "Polkadot"),
It.Is<ValidAccountId>(accountId => accountId.address === ALICE && accountId.type === "Polkadot"),
SESSION_ID)
)
.returns(Promise.resolve(sessionAlice.object()))
sessionRepository.setup(instance => instance.find(
It.Is<ValidAccountId>(accountId => accountId.address === validAccountId(BOB).address && accountId.type === "Polkadot"),
It.Is<ValidAccountId>(accountId => accountId.address === BOB && accountId.type === "Polkadot"),
SESSION_ID)
)
.returns(Promise.resolve(sessionAlice.object()))
} else {
sessionRepository.setup(instance => instance.find(
It.Is<ValidAccountId>(accountId => accountId.address === validAccountId(ALICE).address && accountId.type === "Polkadot"),
It.Is<ValidAccountId>(accountId => accountId.address === ALICE && accountId.type === "Polkadot"),
SESSION_ID)
)
.returns(Promise.resolve(null))
sessionRepository.setup(instance => instance.find(
It.Is<ValidAccountId>(accountId => accountId.address === validAccountId(BOB).address && accountId.type === "Polkadot"),
It.Is<ValidAccountId>(accountId => accountId.address === BOB && accountId.type === "Polkadot"),
SESSION_ID)
)
.returns(Promise.resolve(null))
Expand Down

0 comments on commit 2c49215

Please sign in to comment.