-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from logion-network/feature/update-sync
Update Sync for pallet logionLoc new functions.
- Loading branch information
Showing
20 changed files
with
103 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import { v4 as uuid } from "uuid"; | ||
import { ALICE } from "../../../src/logion/model/addresses.model"; | ||
import { ALICE } from "../../helpers/addresses"; | ||
import moment, { Moment } from "moment"; | ||
import { | ||
LocRequestDescription, | ||
|
@@ -12,6 +12,7 @@ import { | |
VoidInfo, | ||
LocType | ||
} from "../../../src/logion/model/locrequest.model"; | ||
import { UserIdentity } from "../../../src/logion/model/useridentity"; | ||
|
||
describe("LocRequestFactory", () => { | ||
|
||
|
@@ -85,19 +86,32 @@ describe("LocRequestFactory", () => { | |
|
||
it("creates an open Identity LOC with no requester", () => { | ||
givenRequestId(uuid()); | ||
const description = createDescription('Identity'); | ||
const userIdentity = { | ||
firstName: "Scott", | ||
lastName: "Tiger", | ||
email: "[email protected]", | ||
phoneNumber: "+789" | ||
}; | ||
const description = createDescription('Identity', undefined, undefined, userIdentity); | ||
givenLocDescription(description); | ||
whenCreatingOpenLoc(); | ||
}); | ||
|
||
function createDescription(locType: LocType, requesterAddress?: string, requesterIdentityLoc?: string): LocRequestDescription { | ||
it("fails to create an open Identity LOC with no requester when identity is missing", () => { | ||
givenRequestId(uuid()); | ||
const description = createDescription('Identity'); | ||
givenLocDescription(description); | ||
expect(() => whenCreatingOpenLoc()).toThrowError(); | ||
}); | ||
|
||
function createDescription(locType: LocType, requesterAddress?: string, requesterIdentityLoc?: string, userIdentity?: UserIdentity): LocRequestDescription { | ||
return { | ||
requesterAddress, | ||
requesterIdentityLoc, | ||
ownerAddress: ALICE, | ||
description: "Mrs ALice, I want to sell my last art work", | ||
createdOn: moment().toISOString(), | ||
userIdentity: undefined, | ||
userIdentity, | ||
locType | ||
}; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters