-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'deploy-subnet' into base-avalanche2
Signed-off-by: sukantoraymond <[email protected]>
- Loading branch information
Showing
10 changed files
with
347 additions
and
37 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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "gomod" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" |
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,70 @@ | ||
# For most projects, this workflow file will not need changing; you simply need | ||
# to commit it to your repository. | ||
# | ||
# You may wish to alter this file to override the set of languages analyzed, | ||
# or to provide custom queries or build logic. | ||
# | ||
# ******** NOTE ******** | ||
# We have attempted to detect the languages in your repository. Please check | ||
# the `language` matrix defined below to confirm you have the correct set of | ||
# supported CodeQL languages. | ||
# | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
# The branches below must be a subset of the branches above | ||
branches: [main] | ||
schedule: | ||
- cron: "44 11 * * 4" | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: ["go"] | ||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] | ||
# Learn more about CodeQL language support at https://git.io/codeql-language-support | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
queries: security-extended | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v2 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v2 |
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,32 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
env: | ||
GO_VERSION: "1.21.7" | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ env.GO_VERSION }} | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.56.2 | ||
working-directory: . | ||
args: --timeout 5m | ||
- name: Install license check | ||
run: go install github.com/google/[email protected] | ||
- name: Check license | ||
run: addlicense -f ./LICENSE.header -check -v ./**/*.go | ||
#run: addlicense -f ./LICENSE.header -check -v ./**/*.go ./**/**/*.go ./**/**/**/*.go ./**/**/**/**/*.go | ||
|
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,115 @@ | ||
# https://golangci-lint.run/usage/configuration/ | ||
run: | ||
go: "1.21.7" | ||
timeout: 10m | ||
|
||
issues: | ||
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3. | ||
max-same-issues: 0 | ||
# skip auto-generated files. | ||
exclude-files: | ||
- ".*\\.pb\\.go$" | ||
|
||
linters: | ||
# please, do not use `enable-all`: it's deprecated and will be removed soon. | ||
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint | ||
disable-all: true | ||
enable: | ||
- asciicheck | ||
- depguard | ||
- errcheck | ||
- errorlint | ||
- exportloopref | ||
- goconst | ||
- gocritic | ||
- gofmt | ||
- gofumpt | ||
- goimports | ||
- revive | ||
- gosec | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- misspell | ||
- nakedret | ||
- nolintlint | ||
- prealloc | ||
- stylecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- unconvert | ||
- whitespace | ||
- staticcheck | ||
# - structcheck | ||
# - lll | ||
# - gomnd | ||
# - goprintffuncname | ||
# - interfacer | ||
# - typecheck | ||
# - goerr113 | ||
# - noctx | ||
|
||
linters-settings: | ||
errorlint: | ||
# Check for plain type assertions and type switches. | ||
asserts: false | ||
# Check for plain error comparisons. | ||
comparison: false | ||
revive: | ||
rules: | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#bool-literal-in-expr | ||
- name: bool-literal-in-expr | ||
disabled: false | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#early-return | ||
- name: early-return | ||
disabled: false | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#empty-lines | ||
- name: empty-lines | ||
disabled: false | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag | ||
- name: struct-tag | ||
disabled: false | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-naming | ||
- name: unexported-naming | ||
disabled: false | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unhandled-error | ||
- name: unhandled-error | ||
disabled: false | ||
arguments: | ||
- "fmt.Fprint" | ||
- "fmt.Fprintf" | ||
- "fmt.Print" | ||
- "fmt.Printf" | ||
- "fmt.Fprintln" | ||
- "fmt.Println" | ||
- "rand.Read" | ||
- "sb.WriteString" | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-parameter | ||
- name: unused-parameter | ||
disabled: false | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unused-receiver | ||
- name: unused-receiver | ||
disabled: false | ||
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#useless-break | ||
- name: useless-break | ||
disabled: false | ||
staticcheck: | ||
# https://staticcheck.io/docs/options#checks | ||
checks: | ||
- "all" | ||
- "-SA6002" # argument should be pointer-like to avoid allocation, for sync.Pool | ||
- "-SA1019" # deprecated packages e.g., golang.org/x/crypto/ripemd160 | ||
# https://golangci-lint.run/usage/linters#gosec | ||
gosec: | ||
excludes: | ||
- G107 # https://securego.io/docs/rules/g107.html | ||
- G204 | ||
depguard: | ||
rules: | ||
packages: | ||
deny: | ||
- pkg: "io/ioutil" | ||
desc: io/ioutil is deprecated. Use package io or os instead. | ||
- pkg: "github.com/stretchr/testify/assert" | ||
desc: github.com/stretchr/testify/require should be used instead. |
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,29 @@ | ||
BSD 3-Clause License | ||
|
||
Copyright (c) 2022, Ava Labs, Inc. | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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,2 @@ | ||
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. | ||
See the file LICENSE for licensing terms. |
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 |
---|---|---|
|
@@ -18,4 +18,4 @@ func New() *Client { | |
Logger: DefaultLeveledLogger, | ||
} | ||
return client | ||
} | ||
} | ||
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 |
---|---|---|
|
@@ -11,6 +11,4 @@ type Network struct { | |
ID uint32 | ||
|
||
Endpoint string | ||
|
||
ClusterName string | ||
} |
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,82 @@ | ||
// Copyright (C) 2022, Ava Labs, Inc. All rights reserved. | ||
// See the file LICENSE for licensing terms. | ||
package multisig | ||
|
||
import ( | ||
"github.com/ava-labs/avalanche-tooling-sdk-go/network" | ||
"github.com/ava-labs/avalanchego/ids" | ||
"github.com/ava-labs/avalanchego/vms/platformvm/txs" | ||
"github.com/ava-labs/avalanchego/wallet/subnet/primary" | ||
) | ||
|
||
type PChainTxKind int | ||
|
||
const ( | ||
Invalid = iota | ||
CreateBlockchain | ||
TransferSubnetOwnership | ||
) | ||
|
||
type PChainMultisig struct { | ||
_ *txs.Tx | ||
} | ||
|
||
func New(_ *txs.Tx) *PChainMultisig { | ||
return nil | ||
} | ||
|
||
func (*PChainMultisig) ToBytes() ([]byte, error) { | ||
return nil, nil | ||
} | ||
|
||
func (*PChainMultisig) FromBytes(_ []byte) error { | ||
return nil | ||
} | ||
|
||
func (*PChainMultisig) ToFile(_ string) error { | ||
return nil | ||
} | ||
|
||
func (*PChainMultisig) FromFile(_ string) error { | ||
return nil | ||
} | ||
|
||
func (*PChainMultisig) Sign(_ *primary.Wallet) error { | ||
return nil | ||
} | ||
|
||
func (*PChainMultisig) Commit() error { | ||
return nil | ||
} | ||
|
||
func (*PChainMultisig) IsReadyToCommit() error { | ||
return nil | ||
} | ||
|
||
func (*PChainMultisig) GetRemainingSigners() ([]ids.ID, error) { | ||
return nil, nil | ||
} | ||
|
||
func (*PChainMultisig) GetAuthSigners() ([]ids.ID, error) { | ||
return nil, nil | ||
} | ||
|
||
func (*PChainMultisig) GetFeeSigners() ([]ids.ID, error) { | ||
return nil, nil | ||
} | ||
|
||
func (*PChainMultisig) GetKind() PChainTxKind { | ||
return Invalid | ||
} | ||
|
||
func (*PChainMultisig) GetNetwork() (network.Network, error) { | ||
return nil, nil | ||
} | ||
|
||
func (*PChainMultisig) GetSubnetID() (ids.ID, error) { | ||
return ids.Empty, nil | ||
} | ||
|
||
func (*PChainMultisig) GetSubnetOwners() ([]ids.ID, int, error) { | ||
return nil, 0, nil | ||
} |
Oops, something went wrong.