From d91460b79d29ab1b8b8bc6bfc69f0eba1e310c0f Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 11 Nov 2020 11:32:04 +0100 Subject: [PATCH] New contracts Schedule types (#2792) --- .../src/interfaces/contracts/definitions.ts | 75 ++++++++++++++++--- 1 file changed, 65 insertions(+), 10 deletions(-) diff --git a/packages/types/src/interfaces/contracts/definitions.ts b/packages/types/src/interfaces/contracts/definitions.ts index e48935ea93..021eac0912 100644 --- a/packages/types/src/interfaces/contracts/definitions.ts +++ b/packages/types/src/interfaces/contracts/definitions.ts @@ -185,8 +185,68 @@ export default { hashBlake2128PerByte: 'Weight' }, InstructionWeights: { - growMem: 'Weight', - regular: 'Weight' + i64const: 'u32', + i64load: 'u32', + i64store: 'u32', + select: 'u32', + rIf: 'u32', + br: 'u32', + brIf: 'u32', + brIable: 'u32', + brIablePerEntry: 'u32', + call: 'u32', + callIndirect: 'u32', + callIndirectPerParam: 'u32', + localGet: 'u32', + localSet: 'u32', + local_tee: 'u32', + globalGet: 'u32', + globalSet: 'u32', + memoryCurrent: 'u32', + memoryGrow: 'u32', + i64clz: 'u32', + i64ctz: 'u32', + i64popcnt: 'u32', + i64eqz: 'u32', + i64extendsi32: 'u32', + i64extendui32: 'u32', + i32wrapi64: 'u32', + i64eq: 'u32', + i64ne: 'u32', + i64lts: 'u32', + i64ltu: 'u32', + i64gts: 'u32', + i64gtu: 'u32', + i64les: 'u32', + i64leu: 'u32', + i64ges: 'u32', + i64geu: 'u32', + i64add: 'u32', + i64sub: 'u32', + i64mul: 'u32', + i64divs: 'u32', + i64divu: 'u32', + i64rems: 'u32', + i64remu: 'u32', + i64and: 'u32', + i64or: 'u32', + i64xor: 'u32', + i64shl: 'u32', + i64shrs: 'u32', + i64shru: 'u32', + i64rotl: 'u32', + i64rotr: 'u32' + }, + Limits: { + eventTopics: 'u32', + stackHeight: 'u32', + globals: 'u32', + parameters: 'u32', + memoryPages: 'u32', + tableSize: 'u32', + brTableSize: 'u32', + subjectLen: 'u32', + codeSize: 'u32' }, PrefabWasmModule: { scheduleVersion: 'Compact', @@ -233,15 +293,10 @@ export default { }, Schedule: { version: 'u32', - instructionWeights: 'InstructionWeights', - hostFnWeights: 'HostFnWeights', enablePrintln: 'bool', - maxEventTopics: 'u32', - maxStackHeight: 'u32', - maxMemoryPages: 'u32', - maxTableSize: 'u32', - maxSubjectLen: 'u32', - maxCodeSize: 'u32' + limits: 'Limits', + instructionWeights: 'InstructionWeights', + hostFnWeights: 'HostFnWeights' }, SeedOf: 'Hash', TombstoneContractInfo: 'Hash',