[#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>
This commit is contained in:
parent
59d11af046
commit
a4a9a49a76
8 changed files with 2 additions and 41 deletions
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -56,10 +56,6 @@ var (
|
|||
)
|
||||
|
||||
func init() {
|
||||
if runtime.GetTrigger() != runtime.Application {
|
||||
panic("contract has not been called in application node")
|
||||
}
|
||||
|
||||
ctx = storage.GetContext()
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
|
|
@ -52,10 +52,6 @@ var (
|
|||
)
|
||||
|
||||
func init() {
|
||||
if runtime.GetTrigger() != runtime.Application {
|
||||
panic("contract has not been called in application node")
|
||||
}
|
||||
|
||||
ctx = storage.GetContext()
|
||||
}
|
||||
|
||||
|
|
|
@ -25,10 +25,6 @@ var (
|
|||
)
|
||||
|
||||
func init() {
|
||||
if runtime.GetTrigger() != runtime.Application {
|
||||
panic("contract has not been called in application node")
|
||||
}
|
||||
|
||||
ctx = storage.GetContext()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue