@agoric/internal
Advanced tools
Comparing version 0.3.3-dev-0e4c5b5.0 to 0.3.3-dev-0e76960.0
{ | ||
"name": "@agoric/internal", | ||
"version": "0.3.3-dev-0e4c5b5.0+0e4c5b5", | ||
"version": "0.3.3-dev-0e76960.0+0e76960", | ||
"description": "Externally unsupported utilities internal to agoric-sdk", | ||
@@ -23,12 +23,12 @@ "type": "module", | ||
"dependencies": { | ||
"@agoric/base-zone": "0.1.1-dev-0e4c5b5.0+0e4c5b5", | ||
"@endo/common": "^1.2.8", | ||
"@endo/errors": "^1.2.8", | ||
"@endo/far": "^1.1.9", | ||
"@endo/init": "^1.1.7", | ||
"@endo/marshal": "^1.6.2", | ||
"@endo/pass-style": "^1.4.7", | ||
"@endo/patterns": "^1.4.7", | ||
"@endo/promise-kit": "^1.1.8", | ||
"@endo/stream": "^1.2.8", | ||
"@agoric/base-zone": "0.1.1-dev-0e76960.0+0e76960", | ||
"@endo/common": "^1.2.9", | ||
"@endo/errors": "^1.2.9", | ||
"@endo/far": "^1.1.10", | ||
"@endo/init": "^1.1.8", | ||
"@endo/marshal": "^1.6.3", | ||
"@endo/pass-style": "^1.4.8", | ||
"@endo/patterns": "^1.4.8", | ||
"@endo/promise-kit": "^1.1.9", | ||
"@endo/stream": "^1.2.9", | ||
"anylogger": "^0.21.0", | ||
@@ -38,5 +38,5 @@ "jessie.js": "^0.3.4" | ||
"devDependencies": { | ||
"@agoric/cosmic-proto": "0.4.1-dev-0e4c5b5.0+0e4c5b5", | ||
"@endo/exo": "^1.5.7", | ||
"@endo/init": "^1.1.7", | ||
"@agoric/cosmic-proto": "0.4.1-dev-0e76960.0+0e76960", | ||
"@endo/exo": "^1.5.8", | ||
"@endo/init": "^1.1.8", | ||
"ava": "^5.3.0", | ||
@@ -63,5 +63,5 @@ "tsd": "^0.31.1" | ||
"typeCoverage": { | ||
"atLeast": 93.06 | ||
"atLeast": 93.04 | ||
}, | ||
"gitHead": "0e4c5b57754bf73c40833e517d1b720f2f06219f" | ||
"gitHead": "0e7696000a3421a857a8e02eb6bf547e4d649b73" | ||
} |
@@ -49,2 +49,4 @@ /** | ||
let WALLET_SPEND_ACTION: "WALLET_SPEND_ACTION"; | ||
let VTRANSFER_IBC_EVENT: "VTRANSFER_IBC_EVENT"; | ||
let KERNEL_UPGRADE_EVENTS: "KERNEL_UPGRADE_EVENTS"; | ||
} | ||
@@ -59,5 +61,4 @@ export const CORE_EVAL: "CORE_EVAL"; | ||
export const WALLET_SPEND_ACTION: "WALLET_SPEND_ACTION"; | ||
export const CALCULATE_FEES_IN_BEANS: "CALCULATE_FEES_IN_BEANS"; | ||
export const VTRANSFER_IBC_EVENT: "VTRANSFER_IBC_EVENT"; | ||
export const KERNEL_UPGRADE_EVENTS: "KERNEL_UPGRADE_EVENTS"; | ||
//# sourceMappingURL=action-types.d.ts.map |
@@ -59,2 +59,4 @@ // @jessie-check | ||
WALLET_SPEND_ACTION: 'WALLET_SPEND_ACTION', | ||
VTRANSFER_IBC_EVENT: 'VTRANSFER_IBC_EVENT', | ||
KERNEL_UPGRADE_EVENTS: 'KERNEL_UPGRADE_EVENTS', | ||
}); | ||
@@ -73,6 +75,4 @@ harden(QueuedActionType); | ||
WALLET_SPEND_ACTION, | ||
VTRANSFER_IBC_EVENT, | ||
KERNEL_UPGRADE_EVENTS, | ||
} = QueuedActionType; | ||
export const CALCULATE_FEES_IN_BEANS = 'CALCULATE_FEES_IN_BEANS'; | ||
export const VTRANSFER_IBC_EVENT = 'VTRANSFER_IBC_EVENT'; | ||
export const KERNEL_UPGRADE_EVENTS = 'KERNEL_UPGRADE_EVENTS'; |
@@ -31,2 +31,3 @@ /** @type {(namespace: string) => string} */ | ||
export type PrioritySendersManager = ReturnType<typeof makePrioritySendersManager>; | ||
import type { ERef } from '@endo/far'; | ||
//# sourceMappingURL=priority-senders.d.ts.map |
import { Fail, q } from '@endo/errors'; | ||
import { E, Far } from '@endo/far'; | ||
/** @import {ERef} from '@endo/far'; */ | ||
/** @import {StorageNode} from './lib-chainStorage.js'; */ | ||
const PRIORITY_SENDERS_NAMESPACE_RE = /^[a-zA-Z0-9_-]{1,50}$/; | ||
@@ -5,0 +8,0 @@ |
@@ -1,2 +0,2 @@ | ||
export function makeWithQueue(): <T extends (...args: any[]) => any>(inner: T) => (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>; | ||
export function makeWithQueue(): (inner: T) => (...args: Parameters<T>) => Promise<Awaited<ReturnType<T>>>; | ||
//# sourceMappingURL=queue.d.ts.map |
@@ -27,11 +27,12 @@ export function slotToRemotable(_slotId: string, iface?: string): import("@endo/pass-style").RemotableObject<string> & import("@endo/eventual-send").RemotableBrand<{}, {}>; | ||
data: Map<string, string>; | ||
updateNewCellBlockHeight: (blockHeight?: number) => void; | ||
getValues: (path: string) => string[]; | ||
messages: StorageMessage[]; | ||
toStorage: ((message: StorageMessage) => string | number | any[] | { | ||
toStorage: ((message: StorageMessage) => string | number | true | any[] | { | ||
storeName: string; | ||
storeSubkey: string; | ||
} | null | undefined) & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, (message: StorageMessage) => string | number | any[] | { | ||
} | null) & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, (message: StorageMessage) => string | number | true | any[] | { | ||
storeName: string; | ||
storeSubkey: string; | ||
} | null | undefined>; | ||
} | null>; | ||
}; | ||
@@ -38,0 +39,0 @@ export function makeMockChainStorageRoot(): MockChainStorageRoot; |
@@ -14,3 +14,3 @@ // @ts-check | ||
* @import {TotalMap} from './types.js'; | ||
* @import {Marshaller, StorageEntry, StorageMessage, StorageNode} from './lib-chainStorage.js'; | ||
* @import {Marshaller, StorageEntry, StorageMessage, StorageNode, StreamCell} from './lib-chainStorage.js'; | ||
*/ | ||
@@ -104,2 +104,10 @@ | ||
const data = new Map(); | ||
let currentBlockHeight = 0; | ||
const updateNewCellBlockHeight = (blockHeight = currentBlockHeight + 1) => { | ||
blockHeight > currentBlockHeight || | ||
Fail`blockHeight ${blockHeight} must be greater than ${currentBlockHeight}`; | ||
currentBlockHeight = blockHeight; | ||
}; | ||
/** @param {string} prefix */ | ||
@@ -163,3 +171,3 @@ const getChildEntries = prefix => { | ||
} | ||
break; | ||
return true; | ||
} | ||
@@ -172,4 +180,6 @@ case 'append': { | ||
value != null || Fail`attempt to append with no value`; | ||
// In the absence of block boundaries, everything goes in a single StreamCell. | ||
const oldVal = data.get(key); | ||
/** @type {string | undefined} */ | ||
let oldVal = data.get(key); | ||
/** @type {StreamCell | undefined} */ | ||
let streamCell; | ||
@@ -183,6 +193,15 @@ if (oldVal != null) { | ||
} | ||
// StreamCells reset at block boundaries. | ||
if ( | ||
streamCell && | ||
Number(streamCell.blockHeight) !== currentBlockHeight | ||
) { | ||
streamCell = undefined; | ||
oldVal = undefined; | ||
} | ||
} | ||
if (streamCell === undefined) { | ||
streamCell = { | ||
blockHeight: '0', | ||
blockHeight: String(currentBlockHeight), | ||
values: oldVal != null ? [oldVal] : [], | ||
@@ -194,3 +213,3 @@ }; | ||
} | ||
break; | ||
return true; | ||
} | ||
@@ -228,2 +247,3 @@ case 'size': | ||
data: /** @type {Map<string, string>} */ (data), | ||
updateNewCellBlockHeight, | ||
getValues, | ||
@@ -230,0 +250,0 @@ messages, |
@@ -1,3 +0,6 @@ | ||
/** @file adapted from https://raw.githubusercontent.com/sindresorhus/type-fest/main/source/opaque.d.ts */ | ||
/** @file adapted from https://raw.githubusercontent.com/sindresorhus/type-fest/main/source/tagged.d.ts */ | ||
// different name to avoid confusion with pass-style "tagged" | ||
export { Tagged as TypeTag }; | ||
declare const tag: unique symbol; | ||
@@ -4,0 +7,0 @@ |
@@ -31,3 +31,3 @@ // @ts-check | ||
* @param {MapStore} store | ||
* @returns {object} tree of the contents of the store | ||
* @returns {object} tree of the contents of the store | ||
*/ | ||
@@ -34,0 +34,0 @@ export const inspectMapStore = store => { |
export const StorageNodeShape: import("@endo/patterns").Matcher; | ||
/** To be used only for 'helper' facets where the calls are from trusted code. */ | ||
export const UnguardedHelperI: import("@endo/patterns").InterfaceGuard<any>; | ||
/** | ||
* @typedef {number | `${bigint}`} BridgeBigInt Ensure that callees passed a | ||
* bridge message that was serialised from a Golang int64 or uint64 accept | ||
* either a JS number or a stringified JS bigint. | ||
*/ | ||
/** | ||
* @type {import('./types.js').TypedPattern<BridgeBigInt>} | ||
*/ | ||
export const BridgeBigIntShape: import("./types.js").TypedPattern<BridgeBigInt>; | ||
/** | ||
* Ensure that callees passed a | ||
* bridge message that was serialised from a Golang int64 or uint64 accept | ||
* either a JS number or a stringified JS bigint. | ||
*/ | ||
export type BridgeBigInt = number | `${bigint}`; | ||
//# sourceMappingURL=typeGuards.d.ts.map |
// @jessie-check | ||
// @ts-check | ||
@@ -14,1 +15,12 @@ import { M } from '@endo/patterns'; | ||
); | ||
/** | ||
* @typedef {number | `${bigint}`} BridgeBigInt Ensure that callees passed a | ||
* bridge message that was serialised from a Golang int64 or uint64 accept | ||
* either a JS number or a stringified JS bigint. | ||
*/ | ||
/** | ||
* @type {import('./types.js').TypedPattern<BridgeBigInt>} | ||
*/ | ||
export const BridgeBigIntShape = M.or(M.number(), M.string()); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
177336
118
4060
Updated@endo/common@^1.2.9
Updated@endo/errors@^1.2.9
Updated@endo/far@^1.1.10
Updated@endo/init@^1.1.8
Updated@endo/marshal@^1.6.3
Updated@endo/pass-style@^1.4.8
Updated@endo/patterns@^1.4.8
Updated@endo/promise-kit@^1.1.9
Updated@endo/stream@^1.2.9