[#49] Remove trigger check from contracts

This check was useful when there was a single
entry point in contract. But right now there is
no point in this.

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
enable-notary-in-public-chains
Alex Vanin 2021-02-11 19:20:38 +03:00 committed by Alex Vanin
parent 59d11af046
commit a4a9a49a76
8 changed files with 2 additions and 41 deletions

View File

@ -20,15 +20,9 @@ const (
voteKey = "ballots"
)
var (
ctx storage.Context
)
var ctx storage.Context
func init() {
if runtime.GetTrigger() != runtime.Application {
panic("contract has not been called in application node")
}
ctx = storage.GetContext()
}

View File

@ -43,10 +43,6 @@ const (
var ctx storage.Context
func init() {
if runtime.GetTrigger() != runtime.Application {
panic("contract has not been called in application node")
}
ctx = storage.GetContext()
}

View File

@ -59,10 +59,6 @@ func CreateToken() Token {
}
func init() {
if runtime.GetTrigger() != runtime.Application {
panic("contract has not been called in application node")
}
ctx = storage.GetContext()
token = CreateToken()
}

View File

@ -56,10 +56,6 @@ var (
)
func init() {
if runtime.GetTrigger() != runtime.Application {
panic("contract has not been called in application node")
}
ctx = storage.GetContext()
}

View File

@ -80,14 +80,7 @@ var (
)
func init() {
// The trigger determines whether this smart-contract is being
// run in 'verification' or 'application' mode.
if runtime.GetTrigger() != runtime.Application {
panic("contract has not been called in application node")
}
ctx = storage.GetContext()
}
// Init set up initial inner ring node keys.

View File

@ -21,15 +21,9 @@ const (
containerContractKey = "containerScriptHash"
)
var (
ctx storage.Context
)
var ctx storage.Context
func init() {
if runtime.GetTrigger() != runtime.Application {
panic("contract has not been called in application node")
}
ctx = storage.GetContext()
}

View File

@ -52,10 +52,6 @@ var (
)
func init() {
if runtime.GetTrigger() != runtime.Application {
panic("contract has not been called in application node")
}
ctx = storage.GetContext()
}

View File

@ -25,10 +25,6 @@ var (
)
func init() {
if runtime.GetTrigger() != runtime.Application {
panic("contract has not been called in application node")
}
ctx = storage.GetContext()
}