Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(stdlibs): add math/rand #2455

Merged
merged 9 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/docs-404-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'
go-version: '1.22'

- name: Install dependencies
run: go mod download
Expand All @@ -28,4 +28,4 @@ jobs:
run: make -C docs/ build

- name: Run linter
run: make -C docs/ lint
run: make -C docs/ lint
5 changes: 1 addition & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.21.x"
- "1.22.x"
runs-on: ubuntu-latest
timeout-minutes: 30
Expand All @@ -36,7 +35,6 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.21.x"
- "1.22.x"
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
Expand All @@ -60,7 +58,6 @@ jobs:
fail-fast: false
matrix:
goversion:
- "1.21.x"
- "1.22.x"
# unittests: TODO: matrix with contracts
runs-on: ubuntu-latest
Expand Down Expand Up @@ -92,4 +89,4 @@ jobs:
# Find all directories containing gno.mod file
find ./examples -name "gno.mod" -execdir go run "$GNO_CMD" mod tidy \;
# Check if there are changes after running gno mod tidy
git diff --exit-code || (echo "Some gno.mod files are not tidy, please run 'make tidy'." && exit 1)
git diff --exit-code || (echo "Some gno.mod files are not tidy, please run 'make tidy'." && exit 1)
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ The gno repository is primarily based on Go (Golang) and Gno.

The primary tech stack for working on the repository:

- Go (version 1.21+)
- Go (version 1.22+)
- make (for using Makefile configurations)

It is recommended to work on a Unix environment, as most of the tooling is built around ready-made tools in Unix (WSL2
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.21
go 1.22

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

Expand Down
2 changes: 1 addition & 1 deletion contribs/gnofaucet/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gnolang/gno/contribs/gnofaucet

go 1.21
go 1.22

require (
github.com/gnolang/faucet v0.2.1
Expand Down
2 changes: 1 addition & 1 deletion contribs/gnokeykc/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gnolang/gno/contribs/gnokeykc

go 1.21
go 1.22

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

Expand Down
2 changes: 1 addition & 1 deletion contribs/gnomd/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gnolang/gno/contribs/gnomd

go 1.21
go 1.22

require github.com/MichaelMure/go-term-markdown v0.1.4

Expand Down
16 changes: 8 additions & 8 deletions docs/getting-started/local-setup/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ id: installation
# Installation

## Overview
In this tutorial, you will learn how to set up the Gno development environment
locally, so you can get up and running writing Gno code. You will download and
In this tutorial, you will learn how to set up the Gno development environment
locally, so you can get up and running writing Gno code. You will download and
install all the necessary tooling, and validate that it is correctly configured
to run on your machine.

## Prerequisites
- **Git**
- **`make` (for running Makefiles)**
- **Go 1.21+**
- **Go 1.22+**
- **Go Environment Setup**:
- Make sure `$GOPATH` is well-defined, and `$GOPATH/bin` is added to your `$PATH` variable.
- To do this, you can add the following line to your `.bashrc`, `.zshrc` or other config file:
Expand All @@ -30,7 +30,7 @@ GitHub repository somewhere on disk:
git clone https://github.com/gnolang/gno.git
```

## 2. Installing the required tools
## 2. Installing the required tools

There are three tools that should be used for getting started with Gno development:
- `gno` - the GnoVM binary
Expand All @@ -42,7 +42,7 @@ To install all three tools, simply run the following in the root of the repo:
make install
```

## 3. Verifying installation
## 3. Verifying installation

### `gno`
`gno` provides ample functionality to the user, among which is running,
Expand All @@ -59,7 +59,7 @@ You should get the help output from the command:

![gno help](../../assets/getting-started/local-setup/local-setup/gno-help.gif)

Alternatively, if you don't want to have the binary callable system-wide, you
Alternatively, if you don't want to have the binary callable system-wide, you
can run the binary directly:

```bash
Expand All @@ -68,8 +68,8 @@ go run ./cmd/gno --help
```

### `gnodev`
`gnodev` is the go-to Gno development helper tool - it comes with a built in
Gno.land node, a `gnoweb` server to display the state of your smart contracts
`gnodev` is the go-to Gno development helper tool - it comes with a built in
Gno.land node, a `gnoweb` server to display the state of your smart contracts
(realms), and a watcher system to actively track changes in your code. Read more
about `gnodev` [here](../../gno-tooling/cli/gnodev.md).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ In this tutorial, you will learn how to start a local Gno node and connect to an

- **Git**
- **`make` (for running Makefiles)**
- **Go 1.21+**
- **Go 1.22+**
- **Go Environment Setup**: Ensure you have Go set up as outlined in
the [Go official installation documentation](https://go.dev/doc/install) for your environment

Expand Down Expand Up @@ -107,4 +107,4 @@ gnoland start \

That's it! 🎉

Your new Gno node should be up and running, and syncing block data from the remote chain.
Your new Gno node should be up and running, and syncing block data from the remote chain.
4 changes: 2 additions & 2 deletions docs/gno-infrastructure/validators/setting-up-a-new-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Additionally, you will see the different options you can use to make your Gno in

- **Git**
- **`make` (for running Makefiles)**
- **Go 1.21+**
- **Go 1.22+**
- **Go Environment Setup**: Ensure you have Go set up as outlined in
the [Go official installation documentation](https://go.dev/doc/install) for your environment

Expand Down Expand Up @@ -451,4 +451,4 @@ Genesis block generation happens only once during the lifetime of a Gno chain.
This means that if you specify a balances file using `gnoland start`, and the chain has already started (advanced from
block 0), the specified balance sheet will not be applied.

:::
:::
5 changes: 3 additions & 2 deletions docs/reference/go-gno-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ id: go-gno-compatibility

Generics are currently not implemented.

Note that Gno does not support shadowing of built-in types.
Note that Gno does not support shadowing of built-in types.
While the following built-in typecasting assignment would work in Go, this is not supported in Gno.

```go
Expand Down Expand Up @@ -205,7 +205,7 @@ Legend:
| math/big | `tbd` |
| math/bits | `full` |
| math/cmplx | `tbd` |
| math/rand | `todo` |
| math/rand | `full`[^9] |
| mime | `tbd` |
| mime/multipart | `tbd` |
| mime/quotedprintable | `tbd` |
Expand Down Expand Up @@ -291,6 +291,7 @@ Legend:
determinism. Concurrent functionality (such as `time.Ticker`) is not implemented.
[^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`.

## Tooling (`gno` binary)

Expand Down
3 changes: 0 additions & 3 deletions examples/gno.land/p/demo/rand/gno.mod

This file was deleted.

139 changes: 0 additions & 139 deletions examples/gno.land/p/demo/rand/rand.gno

This file was deleted.

Loading
Loading