Merge pull request #708 from nspcc-dev/fix/trigger

core: convert trigger.Type to byte when pushing on stack
This commit is contained in:
Roman Khimov 2020-03-03 16:17:01 +03:00 committed by GitHub
commit 59e6dac351
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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
}