Skip to content

Commit

Permalink
Merge branch 'master' into feat/sign-transactions-genesis
Browse files Browse the repository at this point in the history
  • Loading branch information
Villaquiranm authored Dec 20, 2024
2 parents a0d0b9c + f664c62 commit 5aec227
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 35 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
branches: [ "master", "chain/*" ]
pull_request:
branches: [ "master", "chain/*" ]
paths:
- '**/*.go'
- 'go.mod'
- 'go.sum'
schedule:
- cron: '22 17 * * 3'

Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,10 @@ jobs:
# TODO: consider running lint on every other directories, maybe in "warning" mode?
# TODO: track coverage
fmt:
name: Run gno fmt
runs-on: ubuntu-latest
steps:
- name: gno fmt
uses: ./.github/workflows/gnofmt_template.yml
with:
path: "examples/..."
- name: Check for unformatted gno files
run: |
git diff --exit-code || (echo "Some gno files are not formatted, please run 'make fmt'." && exit 1)
name: Run gno fmt on examples
uses: ./.github/workflows/gnofmt_template.yml
with:
path: "examples/..."

mod-tidy:
strategy:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- '**/*.go'
- 'go.mod'
- 'go.sum'
pull_request:
pull_request_target:
paths:
- '**/*.go'
- 'go.mod'
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/gnofmt_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,15 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.go-version }}

- name: Checkout code
uses: actions/checkout@v4
- name: fmt

- name: Format code with gno fmt
env:
GNOFMT_PATH: ${{ inputs.path }}
run: go run ./gnovm/cmd/gno fmt -v -diff $GNOFMT_PATH

- name: Check for unformatted code
run: |
git diff --exit-code || (echo "Some gno files are not formatted, please run 'make fmt'." && exit 1)
2 changes: 1 addition & 1 deletion contribs/gnodev/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ require (
go.opentelemetry.io/otel/trace v1.29.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap/exp v0.2.0 // indirect
go.uber.org/zap/exp v0.3.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
golang.org/x/mod v0.20.0 // indirect
Expand Down
6 changes: 2 additions & 4 deletions contribs/gnodev/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contribs/gnofaucet/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ require (
go.opentelemetry.io/otel/trace v1.29.0 // indirect
go.opentelemetry.io/proto/otlp v1.3.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap/exp v0.2.0 // indirect
go.uber.org/zap/exp v0.3.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8 // indirect
golang.org/x/mod v0.20.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions contribs/gnofaucet/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions examples/gno.land/p/demo/avlhelpers/avlhelpers.gno
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
// It calls the provided callback function for each key-value pair encountered.
// If the callback returns true, the iteration is stopped.
// The prefix and keys are treated as byte strings, ignoring possible multi-byte Unicode runes.
func IterateByteStringKeysByPrefix(tree avl.Tree, prefix string, cb avl.IterCbFn) {
func IterateByteStringKeysByPrefix(tree avl.ITree, prefix string, cb avl.IterCbFn) {
end := ""
n := len(prefix)
// To make the end of the search, increment the final character ASCII by one.
Expand All @@ -28,7 +28,7 @@ func IterateByteStringKeysByPrefix(tree avl.Tree, prefix string, cb avl.IterCbFn
// Get a list of keys starting from the given prefix. Limit the
// number of results to maxResults.
// The prefix and keys are treated as byte strings, ignoring possible multi-byte Unicode runes.
func ListByteStringKeysByPrefix(tree avl.Tree, prefix string, maxResults int) []string {
func ListByteStringKeysByPrefix(tree avl.ITree, prefix string, maxResults int) []string {
result := []string{}
IterateByteStringKeysByPrefix(tree, prefix, func(key string, value interface{}) bool {
result = append(result, key)
Expand Down
4 changes: 2 additions & 2 deletions examples/gno.land/p/demo/avlhelpers/z_0_filetest.gno
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func main() {
tree := avl.Tree{}
tree := avl.NewTree()

{
// Empty tree.
Expand Down Expand Up @@ -44,7 +44,7 @@ func main() {
println("match: " + matches[0])
}

tree = avl.Tree{}
tree = avl.NewTree()
tree.Set("a\xff", "")
tree.Set("a\xff\xff", "")
tree.Set("b", "")
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 @@ -260,7 +260,7 @@ func GetUserByAddressOrName(input users.AddressOrName) *users.User {
// Get a list of user names starting from the given prefix. Limit the
// number of results to maxResults. (This can be used for a name search tool.)
func ListUsersByPrefix(prefix string, maxResults int) []string {
return avlhelpers.ListByteStringKeysByPrefix(name2User, prefix, maxResults)
return avlhelpers.ListByteStringKeysByPrefix(&name2User, prefix, maxResults)
}

func Resolve(input users.AddressOrName) std.Address {
Expand Down
2 changes: 0 additions & 2 deletions gno.land/pkg/gnoweb/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,6 @@ func (h *WebHandler) highlightSource(fileName string, src []byte) ([]byte, error
lexer = lexers.Get("go")
case ".md":
lexer = lexers.Get("markdown")
case ".mod":
lexer = lexers.Get("gomod")
default:
lexer = lexers.Get("txt") // file kind not supported, fallback on `.txt`
}
Expand Down
2 changes: 1 addition & 1 deletion gno.land/pkg/log/zap.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,5 @@ func NewZapLogger(enc zapcore.Encoder, w io.Writer, level zapcore.Level, opts ..

// ZapLoggerToSlog wraps the given zap logger to an log/slog Logger
func ZapLoggerToSlog(logger *zap.Logger) *slog.Logger {
return slog.New(zapslog.NewHandler(logger.Core(), nil))
return slog.New(zapslog.NewHandler(logger.Core()))
}
4 changes: 2 additions & 2 deletions gnovm/pkg/benchops/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type exporter struct {
// byte 2: StoreCode
// byte 3-6: Duration
// byte 7-10: Size
func (e *exporter) export(code Code, elapsedTime time.Duration, size int) {
func (e *exporter) export(code Code, elapsedTime time.Duration, size int64) {
// the MaxUint32 is 4294967295. It represents 4.29 seconds in duration or 4G bytes.
// It panics not only for overflow protection, but also for abnormal measurements.
if elapsedTime > math.MaxUint32 {
Expand Down Expand Up @@ -74,7 +74,7 @@ func FinishStore() {
fileWriter.export(
code,
measure.storeAccumDur[i]/time.Duration(count),
int(measure.storeAccumSize[i]/count),
measure.storeAccumSize[i]/count,
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.29.0
go.uber.org/multierr v1.11.0
go.uber.org/zap v1.27.0
go.uber.org/zap/exp v0.2.0
go.uber.org/zap/exp v0.3.0
golang.org/x/crypto v0.26.0
golang.org/x/exp v0.0.0-20240613232115-7f521ea00fb8
golang.org/x/mod v0.20.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions misc/autocounterd/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5aec227

Please sign in to comment.