core: fix max contract description limit check

It differs from other parameters in C# code. Fixes #735.
This commit is contained in:
Roman Khimov 2020-03-09 14:18:51 +03:00
parent 4587121c7f
commit eb404ceae3

View file

@ -17,6 +17,8 @@ import (
) )
const ( const (
// MaxContractDescriptionLen is the maximum length for contract description.
MaxContractDescriptionLen = 65536
// MaxContractScriptSize is the maximum script size for a contract. // MaxContractScriptSize is the maximum script size for a contract.
MaxContractScriptSize = 1024 * 1024 MaxContractScriptSize = 1024 * 1024
// MaxContractParametersNum is the maximum number of parameters for a contract. // MaxContractParametersNum is the maximum number of parameters for a contract.
@ -494,7 +496,7 @@ func (ic *interopContext) createContractStateFromVM(v *vm.VM) (*state.Contract,
return nil, errors.New("too big email") return nil, errors.New("too big email")
} }
desc := v.Estack().Pop().Bytes() desc := v.Estack().Pop().Bytes()
if len(desc) > MaxContractStringLen { if len(desc) > MaxContractDescriptionLen {
return nil, errors.New("too big description") return nil, errors.New("too big description")
} }
contract := &state.Contract{ contract := &state.Contract{