-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
58 changed files
with
311 additions
and
1,071 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,6 @@ on: | |
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: lib/go/iinft | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
|
@@ -42,7 +39,6 @@ jobs: | |
uses: golangci/[email protected] | ||
with: | ||
args: "--out-${NO_FUTURE}format colored-line-number --timeout 5m" | ||
working-directory: lib/go/iinft | ||
skip-pkg-cache: true | ||
skip-build-cache: true | ||
|
||
|
@@ -64,7 +60,6 @@ jobs: | |
${{ runner.os }}-go- | ||
- uses: zencargo/github-action-go-mod-tidy@v1 | ||
with: | ||
path: lib/go/iinft | ||
go-version: 1.22 | ||
|
||
test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ node_modules | |
_references | ||
|
||
# Golang bin folder | ||
lib/go/iinft/bin | ||
bin | ||
|
||
# Flow emulator | ||
flowdb | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,45 @@ | ||
GOFILES_NOVENDOR = $(shell find . -type f -name '*.go' -not -path "./vendor/*") | ||
|
||
.PHONY: all test help | ||
.PHONY: all install-deps vet unit-test sequential-test test fmt lint cov module-updates install help | ||
|
||
all: test | ||
all: install-deps vet test | ||
|
||
test: | ||
(cd lib/go/iinft; make test) | ||
install-deps: | ||
go mod download | ||
go mod verify | ||
|
||
vet: | ||
go vet github.com/piprate/sequel-flow-contracts/iinft/... | ||
|
||
unit-test: vet | ||
go test github.com/piprate/sequel-flow-contracts/iinft/... | ||
|
||
test: unit-test | ||
|
||
fmt: | ||
gofmt -s -w ${GOFILES_NOVENDOR} | ||
|
||
lint: | ||
golangci-lint run | ||
|
||
cov: | ||
go test github.com/piprate/sequel-flow-contracts/iinft/... -coverprofile coverage.out;go tool cover -html=coverage.out | ||
|
||
module-updates: | ||
go list -u -m -json all | go-mod-outdated -direct -update | ||
|
||
install: | ||
GOBIN=`pwd`/bin/ go install -v github.com/piprate/sequel-flow-contracts/cmd/... | ||
|
||
help: | ||
@echo '' | ||
@echo ' Targets:' | ||
@echo '--------------------------------------------------' | ||
@echo ' all - Run everything ' | ||
@echo ' test - Run Go library unit tests ' | ||
@echo ' fmt - Format code ' | ||
@echo ' vet - Run vet ' | ||
@echo ' test - Run all tests ' | ||
@echo ' unit-test - Run unit tests ' | ||
@echo ' lint - Run golangci-lint ' | ||
@echo '--------------------------------------------------' | ||
@echo '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package iinft_test | ||
|
||
import ( | ||
"testing" | ||
|
||
. "github.com/piprate/sequel-flow-contracts/iinft" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestLoadFlowKitAccount(t *testing.T) { | ||
acct, err := LoadFlowKitAccount("f669cb8d41ce0c74", "80025f0d1f2fd1ba0e18f447681fdd6a68a62ea86c2c2fefa811df086d40db3c") | ||
require.NoError(t, err) | ||
require.NotEmpty(t, acct) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package iinft | ||
|
||
import ( | ||
"github.com/onflow/flowkit/v2/config" | ||
contracts "github.com/piprate/sequel-flow-contracts" | ||
"github.com/piprate/splash" | ||
) | ||
|
||
// NewNetworkConnectorEmbedded creates a new Splash Connector that uses embedded Flow configuration. | ||
func NewNetworkConnectorEmbedded(network string) (*splash.Connector, error) { | ||
return splash.NewNetworkConnector([]string{config.DefaultPath}, splash.NewEmbedLoader(&contracts.ResourcesFS), network, splash.NewZeroLogger()) | ||
} | ||
|
||
// NewInMemoryConnectorEmbedded creates a new Splash Connector for in-memory emulator that uses embedded Flow configuration. | ||
func NewInMemoryConnectorEmbedded(enableTxFees bool) (*splash.Connector, error) { | ||
return splash.NewInMemoryConnector([]string{config.DefaultPath}, splash.NewEmbedLoader(&contracts.ResourcesFS), enableTxFees, splash.NewZeroLogger()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.