Skip to content

Commit

Permalink
test: update assert origin call test
Browse files Browse the repository at this point in the history
  • Loading branch information
omarsy committed Dec 26, 2024
1 parent 699b5be commit d9f9dfe
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions gno.land/pkg/integration/testdata/assertorigincall.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# | Num | Msg Type | Call from | Entry Point | Result |
# |-----|:--------:|:-------------------:|:----------------------:|:------:|
# | 1 | MsgCall | wallet direct | myrealm.A() | PANIC |
# | 1 | MsgCall | wallet direct | myrealm.A() | pass |
# | 2 | | | myrealm.B() | pass |
# | 3 | | | myrealm.C() | pass |
# | 4 | | through /r/foo | myrealm.A() | PANIC |
Expand All @@ -12,17 +12,17 @@
# | 7 | | through /p/demo/bar | bar.A() | PANIC |
# | 8 | | | bar.B() | pass |
# | 9 | | | bar.C() | PANIC |
# | 10 | MsgRun | wallet direct | myrealm.A() | PANIC |
# | 10 | MsgRun | wallet direct | myrealm.A() | pass |
# | 11 | | | myrealm.B() | pass |
# | 12 | | | myrealm.C() | PANIC |
# | 12 | | | myrealm.C() | pass |
# | 13 | | through /r/foo | myrealm.A() | PANIC |
# | 14 | | | myrealm.B() | pass |
# | 15 | | | myrealm.C() | PANIC |
# | 16 | | through /p/demo/bar | bar.A() | PANIC |
# | 16 | | through /p/demo/bar | bar.A() | pass |
# | 17 | | | bar.B() | pass |
# | 18 | | | bar.C() | PANIC |
# | 19 | MsgCall | wallet direct | std.AssertOriginCall() | pass |
# | 20 | MsgRun | wallet direct | std.AssertOriginCall() | PANIC |
# | 20 | MsgRun | wallet direct | std.AssertOriginCall() | pass |

# Init
## set up and start a new node
Expand All @@ -34,9 +34,9 @@ gnoland start
# The PANIC is expected to fail at the transaction simulation stage, which is why we set gas-wanted to 1.

# Test cases
## 1. MsgCall -> myrlm.A: PANIC
! gnokey maketx call -pkgpath gno.land/r/myrlm -func A -gas-fee 100000ugnot -gas-wanted 1 -broadcast -chainid tendermint_test test1
stderr 'invalid non-origin call'
## 1. MsgCall -> myrlm.A: PASS
gnokey maketx call -pkgpath gno.land/r/myrlm -func A -gas-fee 100000ugnot -gas-wanted 1000000 -broadcast -chainid tendermint_test test1
stdout 'OK!'

## 2. MsgCall -> myrlm.B: PASS
gnokey maketx call -pkgpath gno.land/r/myrlm -func B -gas-fee 100000ugnot -gas-wanted 150000 -broadcast -chainid tendermint_test test1
Expand Down Expand Up @@ -71,17 +71,17 @@ stderr 'invalid non-origin call'
## ! gnokey maketx call -pkgpath gno.land/p/demo/bar -func C -gas-fee 100000ugnot -gas-wanted 5000000 -broadcast -chainid tendermint_test test1
## stderr 'invalid non-origin call'

## 10. MsgRun -> run.main -> myrlm.A: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmA.gno
stderr 'invalid non-origin call'
## 10. MsgRun -> run.main -> myrlm.A: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmA.gno
stdout 'OK!'

## 11. MsgRun -> run.main -> myrlm.B: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmB.gno
stdout 'OK!'

## 12. MsgRun -> run.main -> myrlm.C: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmC.gno
stderr 'invalid non-origin call'
## 12. MsgRun -> run.main -> myrlm.C: PASS
## gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/myrlmC.gno
stdout 'OK!'

## 13. MsgRun -> run.main -> foo.A: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/fooA.gno
Expand All @@ -95,26 +95,26 @@ stdout 'OK!'
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/fooC.gno
stderr 'invalid non-origin call'

## 16. MsgRun -> run.main -> bar.A: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/barA.gno
stderr 'invalid non-origin call'
## 16. MsgRun -> run.main -> bar.A: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/barA.gno
stdout 'OK!'

## 17. MsgRun -> run.main -> bar.B: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/barB.gno
stdout 'OK!'

## 18. MsgRun -> run.main -> bar.C: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 5500000 -broadcast -chainid tendermint_test test1 $WORK/run/barC.gno
stderr 'invalid non-origin call'
## 18. MsgRun -> run.main -> bar.C: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/barC.gno
stdout 'OK!'

## remove testcase 19 due to maketx call forced to call a realm
## 19. MsgCall -> std.AssertOriginCall: pass
## 19. MsgCall -> std.AssertOriginCall: PASS
## gnokey maketx call -pkgpath std -func AssertOriginCall -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1
## stdout 'OK!'

## 20. MsgRun -> std.AssertOriginCall: PANIC
! gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/baz.gno
stderr 'invalid non-origin call'
## 20. MsgRun -> std.AssertOriginCall: PASS
gnokey maketx run -gas-fee 100000ugnot -gas-wanted 10000000 -broadcast -chainid tendermint_test test1 $WORK/run/baz.gno
stdout 'OK!'


-- r/myrlm/rlm.gno --
Expand Down

0 comments on commit d9f9dfe

Please sign in to comment.