core: convert trigger.Type to byte when pushing on stack

This commit is contained in:
Evgenii Stratonikov 2020-03-03 16:13:19 +03:00
parent 3282c6ed41
commit fe3bbbd78a
2 changed files with 7 additions and 1 deletions

View file

@ -35,6 +35,12 @@ import (
* TestRuntimeDeserialize
*/
func TestGetTrigger(t *testing.T) {
v, _, context, chain := createVMAndPushBlock(t)
defer chain.Close()
require.NoError(t, context.runtimeGetTrigger(v))
}
func TestStorageFind(t *testing.T) {
v, contractState, context, chain := createVMAndContractState(t)
defer chain.Close()

View file

@ -288,7 +288,7 @@ func (ic *interopContext) runtimePlatform(v *vm.VM) error {
// runtimeGetTrigger returns the script trigger.
func (ic *interopContext) runtimeGetTrigger(v *vm.VM) error {
v.Estack().PushVal(ic.trigger)
v.Estack().PushVal(byte(ic.trigger))
return nil
}