Skip to content

Commit

Permalink
Merge branch 'master' into graceland-abstractions
Browse files Browse the repository at this point in the history
  • Loading branch information
peterargue authored Feb 7, 2025
2 parents 1a2b239 + f47bb59 commit fbd501a
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 33 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- "release/**"

env:
GO_VERSION: 1.22
GO_VERSION: 1.23

jobs:
test:
Expand Down Expand Up @@ -55,7 +55,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.54
version: v1.63
args: --timeout=10m

docker:
Expand Down
2 changes: 0 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ linters:
- gosimple
- errcheck
- staticcheck
- structcheck
- varcheck
- ineffassign
- typecheck
- misspell
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ values.
| `--verbose`, `-v` | `FLOW_VERBOSE` | `false` | Enable verbose logging (useful for debugging) |
| `--log-format` | `FLOW_LOGFORMAT` | `text` | Output log format (valid values `text`, `JSON`) |
| `--block-time`, `-b` | `FLOW_BLOCKTIME` | `0` | Time between sealed blocks. Valid units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h` |
| `--contracts` | `FLOW_WITHCONTRACTS` | `false` | Start with contracts like [NFT](https://github.com/onflow/flow-nft/blob/master/contracts/NonFungibleToken.cdc) and an [NFT Marketplace](https://github.com/onflow/nft-storefront), when the emulator starts |
| `--contracts` | `FLOW_WITHCONTRACTS` | `false` | Start with contracts like [ExampleNFT](https://github.com/onflow/flow-nft/blob/master/contracts/NonFungibleToken.cdc) when the emulator starts |
| `--service-priv-key` | `FLOW_SERVICEPRIVATEKEY` | random | Private key used for the [service account](https://docs.onflow.org/flow-token/concepts/#flow-service-account) |
| `--service-sig-algo` | `FLOW_SERVICEKEYSIGALGO` | `ECDSA_P256` | Service account key [signature algorithm](https://docs.onflow.org/cadence/language/crypto/#signing-algorithms) |
| `--service-hash-algo` | `FLOW_SERVICEKEYHASHALGO` | `SHA3_256` | Service account key [hash algorithm](https://docs.onflow.org/cadence/language/crypto/#hashing) |
Expand Down
4 changes: 2 additions & 2 deletions emulator/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ func WithComputationReporting(enabled bool) Option {

// Contracts allows users to deploy the given contracts.
// Some default common contracts are pre-configured in the `CommonContracts`
// global variable. It includes contracts such as:
// NonFungibleToken, MetadataViews, NFTStorefront, NFTStorefrontV2, ExampleNFT
// global variable. It includes contracts such as ExampleNFT but could
// contain more contracts in the future.
// The default value is []ContractDescription{}.
func Contracts(contracts []ContractDescription) Option {
return func(c *config) {
Expand Down
11 changes: 0 additions & 11 deletions emulator/contracts.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,11 @@ import (

flowsdk "github.com/onflow/flow-go-sdk"
"github.com/onflow/flow-go-sdk/templates"
"github.com/onflow/flow-go/fvm/systemcontracts"
flowgo "github.com/onflow/flow-go/model/flow"
"github.com/onflow/flow-nft/lib/go/contracts"
nftstorefront "github.com/onflow/nft-storefront/lib/go/contracts"
)

func NewCommonContracts(chain flowgo.Chain) []ContractDescription {
sc := systemcontracts.SystemContractsForChain(chain.ChainID())
ftAddress := flowsdk.HexToAddress(sc.FungibleToken.Address.HexWithPrefix())

serviceAddress := flowsdk.HexToAddress(chain.ServiceAddress().HexWithPrefix())
return []ContractDescription{
{
Expand All @@ -43,12 +38,6 @@ func NewCommonContracts(chain flowgo.Chain) []ContractDescription {
Description: "✨ Example NFT contract",
Source: contracts.ExampleNFT(serviceAddress, serviceAddress, serviceAddress),
},
{
Name: "NFTStorefrontV2",
Address: serviceAddress,
Description: "✨ NFT Storefront contract v2",
Source: nftstorefront.NFTStorefrontV2(ftAddress.String(), serviceAddress.String()),
},
}
}

Expand Down
15 changes: 8 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/onflow/flow-emulator

go 1.22
go 1.23

toolchain go1.22.3
toolchain go1.23.4

require (
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2
Expand All @@ -14,14 +14,13 @@ require (
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
github.com/improbable-eng/grpc-web v0.15.0
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/onflow/cadence v1.3.0
github.com/onflow/cadence v1.3.1
github.com/onflow/crypto v0.25.2
github.com/onflow/flow-core-contracts/lib/go/templates v1.4.0
github.com/onflow/flow-go v0.38.0-util.0.20250122173227-92474d32c877
github.com/onflow/flow-go-sdk v1.3.0
github.com/onflow/flow-go v0.38.0-util.0.20250130182921-c8d283b60d12
github.com/onflow/flow-go-sdk v1.3.1
github.com/onflow/flow-nft/lib/go/contracts v1.2.2
github.com/onflow/flow/protobuf/go/flow v0.4.7
github.com/onflow/nft-storefront/lib/go/contracts v1.0.0
github.com/prometheus/client_golang v1.20.5
github.com/psiemens/graceland v1.0.0
github.com/psiemens/sconfig v0.1.0
Expand Down Expand Up @@ -143,12 +142,14 @@ require (
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onflow/atree v0.8.1 // indirect
github.com/onflow/atree v0.9.0 // indirect
github.com/onflow/bridged-usdc/lib/go/contracts v1.0.0 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 // indirect
github.com/onflow/flow-ft/lib/go/contracts v1.0.1 // indirect
github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect
github.com/onflow/flow-nft/lib/go/templates v1.2.1 // indirect
github.com/onflow/go-ethereum v1.14.7 // indirect
github.com/onflow/nft-storefront/lib/go/contracts v1.0.0 // indirect
github.com/onflow/sdks v0.6.0-preview.1 // indirect
github.com/onflow/wal v1.0.2 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
Expand Down
18 changes: 10 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -721,10 +721,12 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn
github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo=
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onflow/atree v0.8.1 h1:DAnPnL9/Ks3LaAnkQVokokTBG/znTW0DJfovDtJDhLI=
github.com/onflow/atree v0.8.1/go.mod h1:FT6udJF9Q7VQTu3wknDhFX+VV4D44ZGdqtTAE5iztck=
github.com/onflow/cadence v1.3.0 h1:COTlTqUACtTvOeFe7+jP9UDVEU3M3OZzrbzzsEbyqCk=
github.com/onflow/cadence v1.3.0/go.mod h1:638c9Zy25EwflSEE7tBFAVM9N6uwcWt77sgKpyYfSTc=
github.com/onflow/atree v0.9.0 h1:M+Z/UPwzv0/Yy7ChI5T1ZIHD3YN1cs/hxGEs/HWhzaY=
github.com/onflow/atree v0.9.0/go.mod h1:FT6udJF9Q7VQTu3wknDhFX+VV4D44ZGdqtTAE5iztck=
github.com/onflow/bridged-usdc/lib/go/contracts v1.0.0 h1:ofdfKH8KgY6qVFnlngTontds/IBERANeWl0PBPCtPOA=
github.com/onflow/bridged-usdc/lib/go/contracts v1.0.0/go.mod h1:K4/oaEhhnSuJ9q6fpq1w9WEWRGtkNskhmoyH8t+X9Mk=
github.com/onflow/cadence v1.3.1 h1:bs9TFHQy8HHbwTtCtg5cLdyndWhmwq55RSwID1cb220=
github.com/onflow/cadence v1.3.1/go.mod h1:6/47FljVAdl3/31tShI8JOJW0sXYZHK1PwXkE+yk0qA=
github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns=
github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY=
github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 h1:R86HaOuk6vpuECZnriEUE7bw9inC2AtdSn8lL/iwQLQ=
Expand All @@ -735,10 +737,10 @@ github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3
github.com/onflow/flow-ft/lib/go/contracts v1.0.1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A=
github.com/onflow/flow-ft/lib/go/templates v1.0.1 h1:FDYKAiGowABtoMNusLuRCILIZDtVqJ/5tYI4VkF5zfM=
github.com/onflow/flow-ft/lib/go/templates v1.0.1/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE=
github.com/onflow/flow-go v0.38.0-util.0.20250122173227-92474d32c877 h1:bByzC7fL/lufgSmwk7Ro462yaCgvenB7zlD7qxaZgjY=
github.com/onflow/flow-go v0.38.0-util.0.20250122173227-92474d32c877/go.mod h1:h28zpU15mkICF3yKuScgKojxUAhYsQ+Zj7NOBWEvjPM=
github.com/onflow/flow-go-sdk v1.3.0 h1:17xYDaemQBoK2pb9F4S8bH7eAKJSqsuj+DlNHv/FCL0=
github.com/onflow/flow-go-sdk v1.3.0/go.mod h1:Rp424erpOcP7XaZ2zVrOEhBImn6CQIaNX7EaqXdyRa8=
github.com/onflow/flow-go v0.38.0-util.0.20250130182921-c8d283b60d12 h1:RUmzt0EnUZOs0EAsAAMWcVW043JnGn/34WJ7WQGHhGA=
github.com/onflow/flow-go v0.38.0-util.0.20250130182921-c8d283b60d12/go.mod h1:bXxLlDLhyMj05TGYWFJdKTZdySShJMT0eqgommYq48w=
github.com/onflow/flow-go-sdk v1.3.1 h1:2YdTL/R1/DjMYYmyKgArTeQ93GKvLlfCeCpMVH7b8q4=
github.com/onflow/flow-go-sdk v1.3.1/go.mod h1:0rMuCLShdX9F4pLBCPhlMGCFu8gu9SfiXT/Lc9qAi24=
github.com/onflow/flow-nft/lib/go/contracts v1.2.2 h1:XFERNVUDGbZ4ViZjt7P1cGD80mO1PzUJYPfdhXFsGbQ=
github.com/onflow/flow-nft/lib/go/contracts v1.2.2/go.mod h1:eZ9VMMNfCq0ho6kV25xJn1kXeCfxnkhj3MwF3ed08gY=
github.com/onflow/flow-nft/lib/go/templates v1.2.1 h1:SAALMZPDw9Eb9p5kSLnmnFxjyig1MLiT4JUlLp0/bSE=
Expand Down

0 comments on commit fbd501a

Please sign in to comment.