mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-03 01:41:44 +00:00
Feature/auto releases (#1250)
* refactor: rename project from onsonr/sonr to sonr-io/snrd (#1249) * refactor: rename project from onsonr/sonr to sonr-io/snrd * refactor: update package paths to use sonr-io org --------- Co-authored-by: Prad N <prad@didao.xyz> * feat: introduce devbox for consistent development environment * feat: integrate Doppler for secrets management * feat: streamline release process with Devbox * <no value> * bump: version 0.6.3 → 0.6.4 * feat: enable commit-less version bumping * bump: version 0.6.4 → 0.6.5 * feat: streamline release process and update project metadata * feat: streamline build process and configuration * feat: streamline build process by removing release target * bump: version 0.6.5 → 0.6.6 * feat: upgrade to go 1.24 and align binary name * bump: version 0.6.6 → 0.6.7 * feat: streamline release process and update project metadata * bump: version 0.6.3 → 0.6.4 * feat: streamline development and release processes * feat: streamline development and release processes * refactor: streamline release process with Taskfile * feat: enhance goreleaser output with title for better UX * feat: consolidate release notes * bump: version 0.6.3 → 0.6.4 * feat: streamline release process with improved automation * feat: streamline development and release workflow * bump: version 0.6.3 → 0.6.4 * feat: streamline release process with Taskfile and conventional commits * bump: version 0.6.4 → 0.6.5 * feat: enhance Docker image publishing with piped credentials * chore: remove outdated changelog entries * bump: version 0.6.3 → 0.6.4 * feat: improve release process with interactive feedback * feat: enhance release process with real-time version feedback * bump: version 0.6.4 → 0.6.5 * feat: enhance release process with dynamic version display and streamlined automation * bump: version 0.6.3 → 0.6.4 * refactor: streamline release process by removing redundant version display * bump: version 0.6.4 → 0.6.5 * refactor: streamline release process and simplify dev environment * bump: version 0.6.3 → 0.6.4 * ci: simplify PR checks by removing redundant release validation * refactor: consolidate release workflows for improved maintainability * ci: enhance release workflow for automated version publishing --------- Co-authored-by: Prad N <prad@didao.xyz>
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/onsonr/sonr/internal/transaction"
|
||||
"github.com/sonr-io/snrd/internal/transaction"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -8,8 +8,8 @@ import (
|
||||
"cosmossdk.io/core/store"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
|
||||
"github.com/onsonr/sonr/internal/prefixstore"
|
||||
"github.com/onsonr/sonr/internal/transaction"
|
||||
"github.com/sonr-io/snrd/internal/prefixstore"
|
||||
"github.com/sonr-io/snrd/internal/transaction"
|
||||
)
|
||||
|
||||
var AccountStatePrefix = collections.NewPrefix(255)
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
||||
"github.com/cosmos/gogoproto/proto"
|
||||
|
||||
"github.com/onsonr/sonr/internal/transaction"
|
||||
"github.com/sonr-io/snrd/internal/transaction"
|
||||
)
|
||||
|
||||
// ProtoMsgG is a generic interface for protobuf messages.
|
||||
|
||||
@@ -9,8 +9,8 @@ import (
|
||||
"github.com/cosmos/cosmos-sdk/codec"
|
||||
gogoproto "github.com/cosmos/gogoproto/proto"
|
||||
|
||||
"github.com/onsonr/sonr/internal/appmodule"
|
||||
"github.com/onsonr/sonr/internal/transaction"
|
||||
"github.com/sonr-io/snrd/internal/appmodule"
|
||||
"github.com/sonr-io/snrd/internal/transaction"
|
||||
)
|
||||
|
||||
// Dependencies are passed to the constructor of a smart account.
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
|
||||
"google.golang.org/protobuf/proto"
|
||||
|
||||
"github.com/onsonr/sonr/internal/transaction"
|
||||
"github.com/sonr-io/snrd/internal/transaction"
|
||||
)
|
||||
|
||||
// RegisterInitHandler registers an initialisation handler for a smart account that uses protobuf.
|
||||
|
||||
@@ -6,10 +6,10 @@ import (
|
||||
"cosmossdk.io/core/header"
|
||||
"cosmossdk.io/core/store"
|
||||
|
||||
"github.com/onsonr/sonr/internal/branch"
|
||||
"github.com/onsonr/sonr/internal/log"
|
||||
"github.com/onsonr/sonr/internal/router"
|
||||
"github.com/onsonr/sonr/internal/transaction"
|
||||
"github.com/sonr-io/snrd/internal/branch"
|
||||
"github.com/sonr-io/snrd/internal/log"
|
||||
"github.com/sonr-io/snrd/internal/router"
|
||||
"github.com/sonr-io/snrd/internal/transaction"
|
||||
)
|
||||
|
||||
// Environment is used to get all services to their respective module.
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
package crypto_test
|
||||
|
||||
import (
|
||||
"crypto/elliptic"
|
||||
"crypto/rand"
|
||||
"testing"
|
||||
|
||||
"github.com/decred/dcrd/dcrec/secp256k1/v4"
|
||||
libp2p_crypto "github.com/libp2p/go-libp2p/core/crypto"
|
||||
"github.com/libp2p/go-libp2p/core/crypto/pb"
|
||||
"github.com/multiformats/go-multicodec"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/onsonr/sonr/internal/didcrypto"
|
||||
)
|
||||
|
||||
const (
|
||||
exampleDIDStr = "did:key:z6MkhaXgBZDvotDkL5257faiztiGiC2QtKLGpbnnEGta2doK"
|
||||
examplePubKeyStr = "Lm/M42cB3HkUiODQsXRcweM6TByfzEHGO9ND274JcOY="
|
||||
)
|
||||
|
||||
func TestFromPubKey(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
_, ecdsaP256, err := libp2p_crypto.GenerateECDSAKeyPairWithCurve(elliptic.P256(), rand.Reader)
|
||||
require.NoError(t, err)
|
||||
_, ecdsaP384, err := libp2p_crypto.GenerateECDSAKeyPairWithCurve(elliptic.P384(), rand.Reader)
|
||||
require.NoError(t, err)
|
||||
_, ecdsaP521, err := libp2p_crypto.GenerateECDSAKeyPairWithCurve(elliptic.P521(), rand.Reader)
|
||||
require.NoError(t, err)
|
||||
_, ecdsaSecp256k1, err := libp2p_crypto.GenerateECDSAKeyPairWithCurve(secp256k1.S256(), rand.Reader)
|
||||
require.NoError(t, err)
|
||||
_, ed25519, err := libp2p_crypto.GenerateEd25519Key(rand.Reader)
|
||||
require.NoError(t, err)
|
||||
_, rsa, err := libp2p_crypto.GenerateRSAKeyPair(2048, rand.Reader)
|
||||
require.NoError(t, err)
|
||||
_, secp256k1PubKey1, err := libp2p_crypto.GenerateSecp256k1Key(rand.Reader)
|
||||
require.NoError(t, err)
|
||||
|
||||
test := func(pub libp2p_crypto.PubKey, code multicodec.Code) func(t *testing.T) {
|
||||
t.Helper()
|
||||
|
||||
return func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
id, err := crypto.FromPubKey(pub)
|
||||
require.NoError(t, err)
|
||||
p, err := id.PubKey()
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, pub, p)
|
||||
}
|
||||
}
|
||||
|
||||
t.Run("ECDSA with P256 curve", test(ecdsaP256, crypto.P256))
|
||||
t.Run("ECDSA with P384 curve", test(ecdsaP384, crypto.P384))
|
||||
t.Run("ECDSA with P521 curve", test(ecdsaP521, crypto.P521))
|
||||
t.Run("Ed25519", test(ed25519, crypto.Ed25519))
|
||||
t.Run("RSA", test(rsa, crypto.RSA))
|
||||
t.Run("secp256k1", test(secp256k1PubKey1, crypto.Secp256k1))
|
||||
|
||||
t.Run("ECDSA with secp256k1 curve (coerced)", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
id, err := crypto.FromPubKey(ecdsaSecp256k1)
|
||||
require.NoError(t, err)
|
||||
p, err := id.PubKey()
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, pb.KeyType_Secp256k1, p.Type())
|
||||
})
|
||||
|
||||
t.Run("unmarshaled example key (secp256k1)", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
id, err := crypto.FromPubKey(examplePubKey(t))
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, exampleDID(t), id)
|
||||
})
|
||||
}
|
||||
|
||||
func TestToPubKey(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
pubKey, err := crypto.ToPubKey(exampleDIDStr)
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, examplePubKey(t), pubKey)
|
||||
}
|
||||
|
||||
func exampleDID(t *testing.T) crypto.DID {
|
||||
t.Helper()
|
||||
|
||||
id, err := crypto.Parse(exampleDIDStr)
|
||||
require.NoError(t, err)
|
||||
|
||||
return id
|
||||
}
|
||||
|
||||
func examplePubKey(t *testing.T) libp2p_crypto.PubKey {
|
||||
t.Helper()
|
||||
|
||||
pubKeyCfg, err := libp2p_crypto.ConfigDecodeKey(examplePubKeyStr)
|
||||
require.NoError(t, err)
|
||||
|
||||
pubKey, err := libp2p_crypto.UnmarshalEd25519PublicKey(pubKeyCfg)
|
||||
require.NoError(t, err)
|
||||
|
||||
return pubKey
|
||||
}
|
||||
@@ -3,7 +3,7 @@ package router
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/onsonr/sonr/internal/transaction"
|
||||
"github.com/sonr-io/snrd/internal/transaction"
|
||||
)
|
||||
|
||||
// Service is the interface that wraps the basic methods for a router.
|
||||
|
||||
Reference in New Issue
Block a user