AquaVM: passing updated RunParameters structure (support v0.24.2) (#152)

This commit is contained in:
Pavel 2022-04-25 17:58:14 +03:00 committed by GitHub
parent c4122f63b1
commit e9454473ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 16 deletions

14
package-lock.json generated
View File

@ -10,7 +10,7 @@
"license": "Apache-2.0",
"dependencies": {
"@chainsafe/libp2p-noise": "^4.1.1",
"@fluencelabs/avm": "0.23.0",
"@fluencelabs/avm": "0.24.2",
"@fluencelabs/marine-js": "0.2.5",
"async": "3.2.0",
"browser-or-node": "^2.0.0",
@ -703,9 +703,9 @@
"dev": true
},
"node_modules/@fluencelabs/avm": {
"version": "0.23.0",
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.23.0.tgz",
"integrity": "sha512-+cgJltkc8lNa/tr85pV5AEcxLT4dsqRrbhLzdc9MSrkb7cq6xmmHZ3u6o12OflWeAGzRQmaT3uEhSyim/fGI/w=="
"version": "0.24.2",
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.24.2.tgz",
"integrity": "sha512-BD7pr3ZRHLIb9XVt08i+/fX2+B4l5zln6j+5mEIJmDBQETv6Gz7NdsgKn0jUQueBcztR+mw5w7byM66yf6xEnA=="
},
"node_modules/@fluencelabs/avm-runner-background": {
"version": "0.2.0",
@ -12872,9 +12872,9 @@
"dev": true
},
"@fluencelabs/avm": {
"version": "0.23.0",
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.23.0.tgz",
"integrity": "sha512-+cgJltkc8lNa/tr85pV5AEcxLT4dsqRrbhLzdc9MSrkb7cq6xmmHZ3u6o12OflWeAGzRQmaT3uEhSyim/fGI/w=="
"version": "0.24.2",
"resolved": "https://registry.npmjs.org/@fluencelabs/avm/-/avm-0.24.2.tgz",
"integrity": "sha512-BD7pr3ZRHLIb9XVt08i+/fX2+B4l5zln6j+5mEIJmDBQETv6Gz7NdsgKn0jUQueBcztR+mw5w7byM66yf6xEnA=="
},
"@fluencelabs/avm-runner-background": {
"version": "0.2.0",

View File

@ -23,7 +23,7 @@
},
"dependencies": {
"@chainsafe/libp2p-noise": "^4.1.1",
"@fluencelabs/avm": "0.23.0",
"@fluencelabs/avm": "0.24.2",
"@fluencelabs/marine-js": "0.2.5",
"async": "3.2.0",
"browser-or-node": "^2.0.0",

View File

@ -721,6 +721,8 @@ async function runAvmRunner(
{
initPeerId: particle.initPeerId,
currentPeerId: currentPeerId,
timestamp: particle.timestamp,
ttl: particle.ttl,
},
particle.callResults,
);

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
import { callAvm, CallResultsArray, InterpreterResult, LogLevel } from '@fluencelabs/avm';
import { callAvm, CallResultsArray, InterpreterResult, LogLevel, RunParameters } from '@fluencelabs/avm';
import { FluenceAppService } from '@fluencelabs/marine-js';
/**
@ -27,10 +27,7 @@ export type AvmRunner = {
air: string,
prevData: Uint8Array,
data: Uint8Array,
params: {
initPeerId: string;
currentPeerId: string;
},
params: RunParameters,
callResults: CallResultsArray,
) => Promise<InterpreterResult>;
};
@ -53,13 +50,12 @@ export class AVM implements AvmRunner {
air: string,
prevData: Uint8Array,
data: Uint8Array,
params: { initPeerId: string; currentPeerId: string },
runParams: RunParameters,
callResults: CallResultsArray,
): Promise<InterpreterResult> {
return callAvm(
(args) => this._fluenceAppService.callService('avm', 'invoke', args, undefined),
params.initPeerId,
params.currentPeerId,
runParams,
air,
prevData,
data,