-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into mat/rip-spot
- Loading branch information
Showing
1,912 changed files
with
696,232 additions
and
330 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 |
---|---|---|
|
@@ -22,7 +22,7 @@ jobs: | |
# timeout-minutes: 5 | ||
# steps: | ||
# - uses: actions/checkout@v4 | ||
# - uses: bufbuild/[email protected].0 | ||
# - uses: bufbuild/[email protected].1 | ||
# - uses: bufbuild/buf-lint-action@v1 | ||
# with: | ||
# input: "proto" | ||
|
@@ -31,7 +31,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: bufbuild/[email protected].0 | ||
- uses: bufbuild/[email protected].1 | ||
with: | ||
github_token: ${{ github.token }} | ||
- uses: bufbuild/buf-breaking-action@v1 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package v1_2_0 | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/store/types" | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
"github.com/cosmos/cosmos-sdk/types/module" | ||
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" | ||
|
||
"github.com/NibiruChain/nibiru/app/upgrades" | ||
) | ||
|
||
const UpgradeName = "v1.2.0" | ||
|
||
var Upgrade = upgrades.Upgrade{ | ||
UpgradeName: UpgradeName, | ||
CreateUpgradeHandler: func(mm *module.Manager, cfg module.Configurator) upgradetypes.UpgradeHandler { | ||
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { | ||
return mm.RunMigrations(ctx, cfg, fromVM) | ||
} | ||
}, | ||
StoreUpgrades: types.StoreUpgrades{}, | ||
} |
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,3 @@ | ||
package ethclient | ||
|
||
const Bech32Prefix = "nibi" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) 2023-2024 Nibi, Inc. | ||
package codec | ||
|
||
import ( | ||
"github.com/cosmos/cosmos-sdk/codec" | ||
"github.com/cosmos/cosmos-sdk/codec/legacy" | ||
cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" | ||
"github.com/cosmos/cosmos-sdk/crypto/keyring" | ||
|
||
"github.com/NibiruChain/nibiru/eth/crypto/ethsecp256k1" | ||
) | ||
|
||
// RegisterCrypto registers all crypto dependency types with the provided Amino | ||
// codec. | ||
func RegisterCrypto(cdc *codec.LegacyAmino) { | ||
cdc.RegisterConcrete(ðsecp256k1.PubKey{}, | ||
ethsecp256k1.PubKeyName, nil) | ||
cdc.RegisterConcrete(ðsecp256k1.PrivKey{}, | ||
ethsecp256k1.PrivKeyName, nil) | ||
|
||
keyring.RegisterLegacyAminoCodec(cdc) | ||
cryptocodec.RegisterCrypto(cdc) | ||
|
||
// NOTE: update SDK's amino codec to include the ethsecp256k1 keys. | ||
// DO NOT REMOVE unless deprecated on the SDK. | ||
legacy.Cdc = cdc | ||
} |
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,15 @@ | ||
// Copyright (c) 2023-2024 Nibi, Inc. | ||
package codec | ||
|
||
import ( | ||
codectypes "github.com/cosmos/cosmos-sdk/codec/types" | ||
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" | ||
|
||
"github.com/NibiruChain/nibiru/eth/crypto/ethsecp256k1" | ||
) | ||
|
||
// RegisterInterfaces register the cryptographic key concrete types. | ||
func RegisterInterfaces(registry codectypes.InterfaceRegistry) { | ||
registry.RegisterImplementations((*cryptotypes.PubKey)(nil), ðsecp256k1.PubKey{}) | ||
registry.RegisterImplementations((*cryptotypes.PrivKey)(nil), ðsecp256k1.PrivKey{}) | ||
} |
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,34 @@ | ||
package ethsecp256k1 | ||
|
||
import ( | ||
"fmt" | ||
"testing" | ||
) | ||
|
||
func BenchmarkGenerateKey(b *testing.B) { | ||
b.ReportAllocs() | ||
for i := 0; i < b.N; i++ { | ||
if _, err := GenerateKey(); err != nil { | ||
b.Fatal(err) | ||
} | ||
} | ||
} | ||
|
||
func BenchmarkPubKey_VerifySignature(b *testing.B) { | ||
privKey, err := GenerateKey() | ||
if err != nil { | ||
b.Fatal(err) | ||
} | ||
pubKey := privKey.PubKey() | ||
|
||
b.ResetTimer() | ||
b.ReportAllocs() | ||
for i := 0; i < b.N; i++ { | ||
msg := []byte(fmt.Sprintf("%10d", i)) | ||
sig, err := privKey.Sign(msg) | ||
if err != nil { | ||
b.Fatal(err) | ||
} | ||
pubKey.VerifySignature(msg, sig) | ||
} | ||
} |
Oops, something went wrong.