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
validate IEntry { | |
clock: Clock; | |
} | |
validate IEntryBlockList { | |
clock: Clock; | |
} | |
check_signature(IEntryBlockList.publicKey, IEntryBlockList.signature, IEntryBlock) | |
check_not_empty(IEntryBlockList.entryBlockCids); |
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
validate IStoreManifest { | |
ownerIdentity: ID; | |
} | |
validate IEntry { | |
clock: Clock; | |
} | |
validate IEntryBlockList { | |
ownerIdentity: ID; |
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
validate IStoreManifest { | |
ownerIdentity: ID; | |
} | |
validate IEntry { | |
clock: Clock; | |
} | |
validate IEntryBlock { | |
entries: IEntry[]; |
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
validate IStoreManifest { | |
ownerIdentity: ID; | |
} | |
validate IEntry { | |
clock: Clock; | |
} | |
validate IEntryBlock { | |
entries: IEntry[]; |
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
const objectSchema: JTDSchemaType<IObject> = { | |
properties: { | |
_id: { type: 'string' } | |
}, | |
additionalProperties: true | |
} |
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
interface IEntry { | |
value: IObject; | |
clock: number; | |
} |
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
interface IObject { | |
_id: string; | |
} |
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
const allEntries: IEntry[] = mergeArrays(entryBlocks.map(eb => eb && validateEntryBlock(eb) ? eb.entries : [])); |
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
if (!validateStoreManifest(manifest)) { | |
console.log('Store address ' + this._address + ' refers to invalid manifest'); | |
return; | |
} |
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
const sub = storeJson => { | |
const store: IStore = JSON.parse(storeJson.data) as IStore; | |
if (store.senderIdentity == this._identity.id || !validateStore(store)) | |
return; | |
... | |
}; |