@neo-one/node-protocol-esnext-esm
Version:
NEO•ONE NEO node and consensus protocol.
18 lines (16 loc) • 833 B
JavaScript
import { makeErrorWithCode } from '@neo-one/utils-esnext-esm';
export var InventoryType;
(function (InventoryType) {
InventoryType[InventoryType["Transaction"] = 1] = "Transaction";
InventoryType[InventoryType["Block"] = 2] = "Block";
InventoryType[InventoryType["Consensus"] = 224] = "Consensus";
})(InventoryType || (InventoryType = {}));
export const InvalidInventoryTypeError = makeErrorWithCode('INVALID_INVENTORY_TYPE', (inventoryType) => `Expected inventory type, found: ${inventoryType}`);
const isInventoryType = (inventoryType) => InventoryType[inventoryType] !== undefined;
export const assertInventoryType = (inventoryType) => {
if (isInventoryType(inventoryType)) {
return inventoryType;
}
throw new InvalidInventoryTypeError(inventoryType);
};
//# sourceMappingURL=InventoryType.js.map