Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dev/moul/pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
moul committed Sep 26, 2024
2 parents 5c3524d + 7a1a966 commit 97794d7
Show file tree
Hide file tree
Showing 64 changed files with 826 additions and 208 deletions.
34 changes: 0 additions & 34 deletions .benchmarks/README.md

This file was deleted.

9 changes: 0 additions & 9 deletions .benchmarks/gobenchdata-checks.yml

This file was deleted.

3 changes: 2 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
/examples/gno.land/p/demo/svg/ @moul
/examples/gno.land/p/demo/tamagotchi/ @moul
/examples/gno.land/p/demo/ui/ @moul
/examples/gno.land/p/moul/ @moul
/examples/gno.land/r/demo/ @gnolang/tech-staff @gnolang/devrels
/examples/gno.land/r/demo/art/ @moul
/examples/gno.land/r/demo/memeland/ @leohhhn
Expand All @@ -42,7 +43,7 @@
/examples/gno.land/r/gnoland/ @moul
/examples/gno.land/r/sys/ @moul
/examples/gno.land/r/jaekwon/ @jaekwon
/examples/gno.land/r/manfred/ @moul
/examples/gno.land/r/moul/ @moul

# Gno.land.
/gno.land/ @moul @zivkovicmilos
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/benchmark-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ jobs:
secrets: inherit
with:
publish: false
test-flags: "-short"
test-flags: "-short"
external-data-json-path: "./cache/benchmark-data.json"
4 changes: 3 additions & 1 deletion .github/workflows/benchmark-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # run on default branch every day

jobs:
publish:
uses: ./.github/workflows/benchmark_template.yml
secrets: inherit
with:
publish: true
test-flags: "-timeout 50m"
test-flags: "-timeout 50m"
runner-additional-tag: "benchmarks-large"
60 changes: 48 additions & 12 deletions .github/workflows/benchmark_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,65 @@ on:
test-flags:
required: true
type: string
runner-additional-tag:
type: string
default: benchmarks
external-data-json-path:
type: string

permissions:
# deployments permission to deploy GitHub pages website
deployments: write
# contents permission to update benchmark contents in gh-pages branch
contents: write

env:
CGO_ENABLED: 0

jobs:
benchmarks:
if: ${{ github.repository == 'gnolang/gno' }}
runs-on: [self-hosted, Linux, X64, benchmark-v1]
runs-on: [self-hosted, Linux, X64, "${{ inputs.runner-additional-tag }}"]
steps:
- name: checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1

- uses: actions/setup-go@v5
with:
go-version: "1.22.x"
- name: "gobenchdata publish: ${{ inputs.publish }}"
run: go run go.bobheadxi.dev/gobenchdata@v1 action
env:
INPUT_PRUNE_COUNT: 30
INPUT_GO_TEST_FLAGS: "${{ inputs.test-flags }} -run=^$ -cpu 1,2" # executing only using one and two CPUs to not be dependant on the machine cores.
INPUT_PUBLISH: ${{ inputs.publish }}
INPUT_PUBLISH_BRANCH: gh-benchmarks
INPUT_BENCHMARKS_OUT: benchmarks.json
INPUT_CHECKS: ${{ !inputs.publish }}
INPUT_CHECKS_CONFIG: .benchmarks/gobenchdata-checks.yml

- name: Run benchmark
run: |
go test -benchmem -bench=. ./... -run=^$ \
-cpu 1,2 ${{ inputs.test-flags }} | tee benchmarks.txt
- name: Download previous benchmark data
uses: actions/cache@v4
with:
path: ./cache
key: ${{ runner.os }}-benchmark

- name: Store benchmark results into `gh-benchmarks` branch
uses: benchmark-action/github-action-benchmark@v1
# see https://github.com/benchmark-action/github-action-benchmark?tab=readme-ov-file#action-inputs
with:
name: Go Benchmarks
tool: 'go'
output-file-path: benchmarks.txt
# Where the previous data file is stored
external-data-json-path: ${{ inputs.external-data-json-path }}
# Show alert with commit comment on detecting possible performance regression
alert-threshold: '20%'
fail-on-alert: true
comment-on-alert: true
# Enable Job Summary for PRs
summary-always: true
github-token: ${{ secrets.GITHUB_TOKEN }}
# NOTE you need to use a separate GITHUB PAT token that has a write access to the specified repository.
# gh-repository: 'github.com/gnolang/benchmarks' # on gh-pages branch
gh-pages-branch: gh-benchmarks
benchmark-data-dir-path: .
auto-push: ${{ inputs.publish }}
alert-comment-cc-users: '@ajnavarro,@thehowl,@zivkovicmilos'
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/foo20/foo20.gno
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var (
)

func init() {
admin = ownable.NewWithAddress("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq") // @manfred
admin = ownable.NewWithAddress("g1manfred47kzduec920z88wfr64ylksmdcedlf5") // @moul
banker = grc20.NewBanker("Foo", "FOO", 4)
banker.Mint(admin.Owner(), 1000000*10000) // @administrator (1M)
token = banker.Token()
Expand Down
4 changes: 2 additions & 2 deletions examples/gno.land/r/demo/foo20/foo20_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func TestReadOnlyPublicMethods(t *testing.T) {
var (
admin = pusers.AddressOrName("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
admin = pusers.AddressOrName("g1manfred47kzduec920z88wfr64ylksmdcedlf5")
alice = pusers.AddressOrName(testutils.TestAddress("alice"))
bob = pusers.AddressOrName(testutils.TestAddress("bob"))
)
Expand Down Expand Up @@ -60,7 +60,7 @@ func TestReadOnlyPublicMethods(t *testing.T) {

func TestErrConditions(t *testing.T) {
var (
admin = pusers.AddressOrName("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
admin = pusers.AddressOrName("g1manfred47kzduec920z88wfr64ylksmdcedlf5")
alice = pusers.AddressOrName(testutils.TestAddress("alice"))
empty = pusers.AddressOrName("")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

func TestReadOnlyPublicMethods(t *testing.T) {
admin := std.Address("g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj")
manfred := std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
manfred := std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")
unknown := std.Address("g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5") // valid but never used.
NewWithAdmin("Foo", "FOO", 4, 10_000*1_000_000, 0, admin)
NewWithAdmin("Bar", "BAR", 4, 10_000*1_000, 0, admin)
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/groups/z_1_a_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

var gid groups.GroupID

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/groups/z_2_a_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

var gid groups.GroupID

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
1 change: 1 addition & 0 deletions examples/gno.land/r/demo/users/gno.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ require (
gno.land/p/demo/avl v0.0.0-latest
gno.land/p/demo/avl/pager v0.0.0-latest
gno.land/p/demo/avlhelpers v0.0.0-latest
gno.land/p/demo/uassert v0.0.0-latest
gno.land/p/demo/users v0.0.0-latest
)
3 changes: 3 additions & 0 deletions examples/gno.land/r/demo/users/preregister.gno
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ var preRegisteredUsers = []struct {
{"nt", "g15ge0ae9077eh40erwrn2eq0xw6wupwqthpv34l"}, // -> @r_nt
{"sys", "g1r929wt2qplfawe4lvqv9zuwfdcz4vxdun7qh8l"}, // -> @r_sys
{"x", "g164sdpew3c2t3rvxj3kmfv7c7ujlvcw2punzzuz"}, // -> @r_x

// test1 user
{"test1", "g1jg8mtutu9khhfwc4nxmuhcpftf0pajdhfvsqf5"}, // -> @test1
}

func init() {
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/users.gno
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
// State

var (
admin std.Address = "g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq" // @moul
admin std.Address = "g1manfred47kzduec920z88wfr64ylksmdcedlf5" // @moul

restricted avl.Tree // Name -> true - restricted name
name2User avl.Tree // Name -> *users.User
Expand Down
13 changes: 13 additions & 0 deletions examples/gno.land/r/demo/users/users_test.gno
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package users

import (
"testing"

"gno.land/p/demo/uassert"
)

func TestPreRegisteredTest1(t *testing.T) {
names := ListUsersByPrefix("test1", 1)
uassert.Equal(t, len(names), 1)
uassert.Equal(t, names[0], "test1")
}
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_10_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func init() {
caller := std.GetOrigCaller() // main
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_11_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_11b_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_2_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_3_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_4_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
3 changes: 2 additions & 1 deletion examples/gno.land/r/demo/users/z_5_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down Expand Up @@ -50,6 +50,7 @@ func main() {
// * [sys](/r/demo/users:sys)
// **1** | [2](?page=2)
// ========================================
// * [test1](/r/demo/users:test1)
// * [x](/r/demo/users:x)
// [1](?page=1) | **2**
// ========================================
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_6_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller()
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_7_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_7b_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_8_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/demo/users/z_9_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"gno.land/r/demo/users"
)

const admin = std.Address("g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq")
const admin = std.Address("g1manfred47kzduec920z88wfr64ylksmdcedlf5")

func main() {
caller := std.GetOrigCaller() // main
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/gnoland/blog/admin.gno
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var (

func init() {
// adminAddr = std.GetOrigCaller() // FIXME: find a way to use this from the main's genesis.
adminAddr = "g1u7y667z64x2h7vc6fmpcprgey4ck233jaww9zq"
adminAddr = "g1manfred47kzduec920z88wfr64ylksmdcedlf5" // @moul
}

func AdminSetAdminAddr(addr std.Address) {
Expand Down
Loading

0 comments on commit 97794d7

Please sign in to comment.