Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gnolang/gno into 2192-banker-inst…
Browse files Browse the repository at this point in the history
…ance
  • Loading branch information
Villaquiranm committed Oct 22, 2024
2 parents 8efd414 + 5c876f3 commit 091a123
Show file tree
Hide file tree
Showing 114 changed files with 10,712 additions and 3,215 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
/gno.land/cmd/genesis/ @zivkovicmilos
/gno.land/cmd/gnokey/ @jaekwon @moul @gfanton
/gno.land/cmd/gnoland/ @zivkovicmilos @gnolang/devops
/gno.land/cmd/gnoweb/ @gfanton @thehowl
/gno.land/cmd/gnoweb/ @gfanton @thehowl @alexiscolin
/gno.land/pkg/gnoclient/ @zivkovicmilos @leohhhn @gfanton
/gno.land/pkg/gnoland/ @zivkovicmilos @gfanton
/gno.land/pkg/keyscli/ @jaekwon @moul @gfanton
Expand Down
5 changes: 5 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ flag_management:
- type: patch
target: auto # Let's decrease this later.
threshold: 10

ignore:
- "gnovm/stdlibs/generated.go"
- "gnovm/tests/stdlibs/generated.go"
- "**/*.pb.go"
1 change: 0 additions & 1 deletion .github/workflows/misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
- genproto
- genstd
- goscan
- logos
- loop
name: Run Main
uses: ./.github/workflows/main_template.yml
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightlies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
go-version: "1.22.x"
cache: true

- uses: sigstore/cosign-installer@v3.6.0
- uses: anchore/sbom-action/[email protected].2
- uses: sigstore/cosign-installer@v3.7.0
- uses: anchore/sbom-action/[email protected].5

- uses: docker/login-action@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/releaser-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ jobs:
go-version: "1.22.x"
cache: true

- uses: sigstore/cosign-installer@v3.6.0
- uses: anchore/sbom-action/[email protected].2
- uses: sigstore/cosign-installer@v3.7.0
- uses: anchore/sbom-action/[email protected].5

- uses: docker/login-action@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:
go-version: "1.22.x"
cache: true

- uses: sigstore/cosign-installer@v3.6.0
- uses: anchore/sbom-action/[email protected].2
- uses: sigstore/cosign-installer@v3.7.0
- uses: anchore/sbom-action/[email protected].5

- uses: docker/login-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion contribs/gnodev/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gnolang/gno/contribs/gnodev

go 1.22
go 1.22.0

replace github.com/gnolang/gno => ../..

Expand Down
7 changes: 3 additions & 4 deletions contribs/gnodev/pkg/dev/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,8 @@ func newNodeConfig(tmc *tmcfg.Config, chainid string, appstate gnoland.GnoGenesi
}

return &gnoland.InMemoryNodeConfig{
PrivValidator: pv,
TMConfig: tmc,
Genesis: genesis,
GenesisMaxVMCycles: 100_000_000,
PrivValidator: pv,
TMConfig: tmc,
Genesis: genesis,
}
}
8 changes: 5 additions & 3 deletions docs/reference/go-gno-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ Legend:
| runtime/trace | `gospec` |
| slices | `gnics` |
| sort | `part`[^6] |
| strconv | `part` |
| strconv | `full`[^10] |
| strings | `full` |
| sync | `tbd` |
| sync/atomic | `tbd` |
Expand Down Expand Up @@ -292,6 +292,8 @@ Legend:
[^8]: `crypto/ed25519` is currently only implemented for `Verify`, which should
still cover a majority of use cases. A full implementation is welcome.
[^9]: `math/rand` in Gno ports over Go's `math/rand/v2`.
[^10]: `strconv` does not have the methods relating to types `complex64` and
`complex128`.

## Tooling (`gno` binary)

Expand All @@ -301,9 +303,9 @@ Legend:
| go build | gno transpile -gobuild | same intention, limited compatibility |
| go clean | gno clean | same intention, limited compatibility |
| go doc | gno doc | limited compatibility; see https://github.com/gnolang/gno/issues/522 |
| go env | | |
| go env | gno env | |
| go fix | | |
| go fmt | | gofmt (& similar tools, like gofumpt) works on gno code. |
| go fmt | gno fmt | gofmt (& similar tools, like gofumpt) works on gno code. |
| go generate | | |
| go get | | see `gno mod download`. |
| go help | gno $cmd --help | ie. `gno doc --help` |
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/p/demo/gnorkle/gnorkle/instance.gno
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func (i *Instance) GetFeedDefinitions(forAddress string) (string, error) {

first = false
buf.Write(taskBytes)
return true
return false
})

if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion examples/gno.land/r/gnoland/ghverify/contract.gno
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ func Render(_ string) string {
result += `"` + handle + `": "` + address.(string) + `"`
appendComma = true

return true
return false
})

return result + "}"
Expand Down
33 changes: 20 additions & 13 deletions examples/gno.land/r/gnoland/ghverify/contract_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (

func TestVerificationLifecycle(t *testing.T) {
defaultAddress := std.GetOrigCaller()
userAddress := std.Address(testutils.TestAddress("user"))
user1Address := std.Address(testutils.TestAddress("user 1"))
user2Address := std.Address(testutils.TestAddress("user 2"))

// Verify request returns no feeds.
result := GnorkleEntrypoint("request")
Expand All @@ -18,7 +19,7 @@ func TestVerificationLifecycle(t *testing.T) {
}

// Make a verification request with the created user.
std.TestSetOrigCaller(userAddress)
std.TestSetOrigCaller(user1Address)
RequestVerification("deelawn")

// A subsequent request from the same address should panic because there is
Expand All @@ -42,42 +43,48 @@ func TestVerificationLifecycle(t *testing.T) {
t.Fatalf("expected empty request result, got %s", result)
}

// Make a verification request with the created user.
std.TestSetOrigCaller(user2Address)
RequestVerification("omarsy")

// Set the caller back to the whitelisted user and verify that the feed data
// returned matches what should have been created by the `RequestVerification`
// invocation.
std.TestSetOrigCaller(defaultAddress)
result = GnorkleEntrypoint("request")
expResult := `[{"id":"` + string(userAddress) + `","type":"0","value_type":"string","tasks":[{"gno_address":"` +
string(userAddress) + `","github_handle":"deelawn"}]}]`
expResult := `[{"id":"` + string(user1Address) + `","type":"0","value_type":"string","tasks":[{"gno_address":"` +
string(user1Address) + `","github_handle":"deelawn"}]},` +
`{"id":"` + string(user2Address) + `","type":"0","value_type":"string","tasks":[{"gno_address":"` +
string(user2Address) + `","github_handle":"omarsy"}]}]`
if result != expResult {
t.Fatalf("expected request result %s, got %s", expResult, result)
}

// Try to trigger feed ingestion from the non-authorized user.
std.TestSetOrigCaller(userAddress)
std.TestSetOrigCaller(user1Address)
func() {
defer func() {
if r := recover(); r != nil {
errMsg = r.(error).Error()
}
}()
GnorkleEntrypoint("ingest," + string(userAddress) + ",OK")
GnorkleEntrypoint("ingest," + string(user1Address) + ",OK")
}()
if errMsg != "caller not whitelisted" {
t.Fatalf("expected caller not whitelisted, got %s", errMsg)
}

// Set the caller back to the whitelisted user and transfer contract ownership.
std.TestSetOrigCaller(defaultAddress)
SetOwner(userAddress)
SetOwner(defaultAddress)

// Now trigger the feed ingestion from the user and new owner and only whitelisted address.
std.TestSetOrigCaller(userAddress)
GnorkleEntrypoint("ingest," + string(userAddress) + ",OK")
GnorkleEntrypoint("ingest," + string(user1Address) + ",OK")
GnorkleEntrypoint("ingest," + string(user2Address) + ",OK")

// Verify the ingestion autocommitted the value and triggered the post handler.
data := Render("")
expResult = `{"deelawn": "` + string(userAddress) + `"}`
expResult = `{"deelawn": "` + string(user1Address) + `","omarsy": "` + string(user2Address) + `"}`
if data != expResult {
t.Fatalf("expected render data %s, got %s", expResult, data)
}
Expand All @@ -89,10 +96,10 @@ func TestVerificationLifecycle(t *testing.T) {
}

// Check that the accessor functions are working as expected.
if handle := GetHandleByAddress(string(userAddress)); handle != "deelawn" {
if handle := GetHandleByAddress(string(user1Address)); handle != "deelawn" {
t.Fatalf("expected deelawn, got %s", handle)
}
if address := GetAddressByHandle("deelawn"); address != string(userAddress) {
t.Fatalf("expected %s, got %s", string(userAddress), address)
if address := GetAddressByHandle("deelawn"); address != string(user1Address) {
t.Fatalf("expected %s, got %s", string(user1Address), address)
}
}
2 changes: 1 addition & 1 deletion examples/gno.land/r/gnoland/pages/page_contribute.gno
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Don't fear your work being "stolen": if a submission is the result of multiple p
- If you, for instance, cannot complete the entirety of the task or, as a non-developer, can only contribute a part of the specification/implementation, you may still be awarded a bounty for your input in the contribution.
- If Alice makes a PR that aside from implementing what's required, also undertakes creating useful tools among the way, she may qualify for an "outstanding contribution"; and may be awarded up to 25% more of the original bounty's value. Or she may also ask if the team would be willing to offer a different bounty for the implementation of the tools.
Participants in the gno.land Bounty Program must meet the legal Terms and Conditions referenced [here](https://docs.google.com/document/d/1aXrZ6japdAykB5FLmHCCeBZTo-2tbZQHSQi79ITaTK0).
Participants in the gno.land Bounty Program must meet the legal Terms and Conditions referenced [here](https://docs.google.com/document/d/e/2PACX-1vSUF-JwIXGscrNsc5QBD7Pa6i83mXUGogAEIf1wkeb_w42UgL3Lj6jFKMlNTdwEMUnhsLkjRlhe25K4/pub).
### Bounty sizes
Expand Down
9 changes: 9 additions & 0 deletions examples/gno.land/r/stefann/home/gno.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module gno.land/r/stefann/home

require (
gno.land/p/demo/avl v0.0.0-latest
gno.land/p/demo/ownable v0.0.0-latest
gno.land/p/demo/testutils v0.0.0-latest
gno.land/p/demo/ufmt v0.0.0-latest
gno.land/r/stefann/registry v0.0.0-latest
)
Loading

0 comments on commit 091a123

Please sign in to comment.