core: add prices for TRY* opcodes

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2020-07-29 13:40:53 +03:00
parent 51ae12e4fd
commit c09ea04df3

View file

@ -14,65 +14,65 @@ func opcodePrice(opcodes ...opcode.Opcode) int64 {
}
var prices = map[opcode.Opcode]int64{
opcode.PUSHINT8: 30,
opcode.PUSHINT32: 30,
opcode.PUSHINT64: 30,
opcode.PUSHINT16: 30,
opcode.PUSHINT128: 120,
opcode.PUSHINT256: 120,
opcode.PUSHA: 120,
opcode.PUSHNULL: 30,
opcode.PUSHDATA1: 180,
opcode.PUSHDATA2: 13000,
opcode.PUSHDATA4: 110000,
opcode.PUSHM1: 30,
opcode.PUSH0: 30,
opcode.PUSH1: 30,
opcode.PUSH2: 30,
opcode.PUSH3: 30,
opcode.PUSH4: 30,
opcode.PUSH5: 30,
opcode.PUSH6: 30,
opcode.PUSH7: 30,
opcode.PUSH8: 30,
opcode.PUSH9: 30,
opcode.PUSH10: 30,
opcode.PUSH11: 30,
opcode.PUSH12: 30,
opcode.PUSH13: 30,
opcode.PUSH14: 30,
opcode.PUSH15: 30,
opcode.PUSH16: 30,
opcode.NOP: 30,
opcode.JMP: 70,
opcode.JMPL: 70,
opcode.JMPIF: 70,
opcode.JMPIFL: 70,
opcode.JMPIFNOT: 70,
opcode.JMPIFNOTL: 70,
opcode.JMPEQ: 70,
opcode.JMPEQL: 70,
opcode.JMPNE: 70,
opcode.JMPNEL: 70,
opcode.JMPGT: 70,
opcode.JMPGTL: 70,
opcode.JMPGE: 70,
opcode.JMPGEL: 70,
opcode.JMPLT: 70,
opcode.JMPLTL: 70,
opcode.JMPLE: 70,
opcode.JMPLEL: 70,
opcode.CALL: 22000,
opcode.CALLL: 22000,
opcode.CALLA: 22000,
opcode.ABORT: 30,
opcode.ASSERT: 30,
opcode.THROW: 22000,
//opcode.TRY: 100,
//opcode.TRY_L: 100,
//opcode.ENDTRY: 100,
//opcode.ENDTRY_L: 100,
//opcode.ENDFINALLY: 100,
opcode.PUSHINT8: 30,
opcode.PUSHINT32: 30,
opcode.PUSHINT64: 30,
opcode.PUSHINT16: 30,
opcode.PUSHINT128: 120,
opcode.PUSHINT256: 120,
opcode.PUSHA: 120,
opcode.PUSHNULL: 30,
opcode.PUSHDATA1: 180,
opcode.PUSHDATA2: 13000,
opcode.PUSHDATA4: 110000,
opcode.PUSHM1: 30,
opcode.PUSH0: 30,
opcode.PUSH1: 30,
opcode.PUSH2: 30,
opcode.PUSH3: 30,
opcode.PUSH4: 30,
opcode.PUSH5: 30,
opcode.PUSH6: 30,
opcode.PUSH7: 30,
opcode.PUSH8: 30,
opcode.PUSH9: 30,
opcode.PUSH10: 30,
opcode.PUSH11: 30,
opcode.PUSH12: 30,
opcode.PUSH13: 30,
opcode.PUSH14: 30,
opcode.PUSH15: 30,
opcode.PUSH16: 30,
opcode.NOP: 30,
opcode.JMP: 70,
opcode.JMPL: 70,
opcode.JMPIF: 70,
opcode.JMPIFL: 70,
opcode.JMPIFNOT: 70,
opcode.JMPIFNOTL: 70,
opcode.JMPEQ: 70,
opcode.JMPEQL: 70,
opcode.JMPNE: 70,
opcode.JMPNEL: 70,
opcode.JMPGT: 70,
opcode.JMPGTL: 70,
opcode.JMPGE: 70,
opcode.JMPGEL: 70,
opcode.JMPLT: 70,
opcode.JMPLTL: 70,
opcode.JMPLE: 70,
opcode.JMPLEL: 70,
opcode.CALL: 22000,
opcode.CALLL: 22000,
opcode.CALLA: 22000,
opcode.ABORT: 30,
opcode.ASSERT: 30,
opcode.THROW: 22000,
opcode.TRY: 100,
opcode.TRYL: 100,
opcode.ENDTRY: 100,
opcode.ENDTRYL: 100,
opcode.ENDFINALLY: 100,
opcode.RET: 0,
opcode.SYSCALL: 0,
opcode.DEPTH: 60,