-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add challnges/time-simple.txtar. In integration_test, add Test…
…TestdataChallenges. See the PR. Signed-off-by: Jeff Thompson <[email protected]>
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# challenges folder | ||
|
||
The challenges folder has tests which fail. The challenge is to fix the cause of the failure. | ||
When the test passes, it should be moved to the parent testdata folder. | ||
|
20 changes: 20 additions & 0 deletions
20
gno.land/cmd/gnoland/testdata/challenges/time-simple.txtar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Run this test in ../../gnoland with: | ||
# go test -v . --run TestTestdataChallenges/time-simple | ||
# The addpkg fails due to changes in PR https://github.com/gnolang/gno/pull/1702 | ||
# To show that this test should pass, you can revert that PR and run again. | ||
|
||
gnoland start | ||
|
||
gnokey maketx addpkg -pkgdir $WORK -pkgpath gno.land/r/time_simple -gas-fee 1ugnot -gas-wanted 10000000 -broadcast -chainid=tendermint_test test1 | ||
stdout OK! | ||
|
||
-- time_simple.gno -- | ||
package time_simple | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
func GetUnixTime() int64 { | ||
return time.Now().Unix() | ||
} |