cli: add scope check tests for invocations
It doesn't trigger the problem fixed in the previous commit because here CreateTxFromScript is used with pre-calculated GAS value from InvokeFunction and thus it's not performing invocation. Still, it's a nice test extension.
This commit is contained in:
parent
f58d424c6d
commit
e5b5a3b118
2 changed files with 18 additions and 2 deletions
8
cli/testdata/deploy/main.go
vendored
8
cli/testdata/deploy/main.go
vendored
|
@ -40,6 +40,14 @@ func Fail() {
|
|||
panic("as expected")
|
||||
}
|
||||
|
||||
// CheckSenderWitness checks sender's witness.
|
||||
func CheckSenderWitness() {
|
||||
tx := runtime.GetScriptContainer()
|
||||
if !runtime.CheckWitness(tx.Sender) {
|
||||
panic("not witnessed")
|
||||
}
|
||||
}
|
||||
|
||||
// Update updates contract with the new one.
|
||||
func Update(script, manifest []byte) {
|
||||
ctx := storage.GetReadOnlyContext()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue