renaming from ethermint to laconic #69

Closed
0xmuralik wants to merge 3 commits from murali/minor-changes into main
88 changed files with 323 additions and 323 deletions

View File

@ -311,7 +311,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
from := acc.GetAddress() from := acc.GetAddress()
gas := uint64(200000) gas := uint64(200000)
amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas)))) amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas))))
txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "ethermint_9000-1", gas, amount) txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "laconic_9000-1", gas, amount)
return txBuilder.GetTx() return txBuilder.GetTx()
}, false, false, true, }, false, false, true,
}, },
@ -322,7 +322,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
gas := uint64(200000) gas := uint64(200000)
coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas))) coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas)))
amount := sdk.NewCoins(coinAmount) amount := sdk.NewCoins(coinAmount)
txBuilder := suite.CreateTestEIP712TxBuilderMsgDelegate(from, privKey, "ethermint_9000-1", gas, amount) txBuilder := suite.CreateTestEIP712TxBuilderMsgDelegate(from, privKey, "laconic_9000-1", gas, amount)
return txBuilder.GetTx() return txBuilder.GetTx()
}, false, false, true, }, false, false, true,
}, },
@ -333,7 +333,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20)) coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20))
amount := sdk.NewCoins(coinAmount) amount := sdk.NewCoins(coinAmount)
gas := uint64(200000) gas := uint64(200000)
txBuilder := suite.CreateTestEIP712MsgCreateValidator(from, privKey, "ethermint_9000-1", gas, amount) txBuilder := suite.CreateTestEIP712MsgCreateValidator(from, privKey, "laconic_9000-1", gas, amount)
return txBuilder.GetTx() return txBuilder.GetTx()
}, false, false, true, }, false, false, true,
}, },
@ -346,7 +346,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
gas := uint64(200000) gas := uint64(200000)
// reusing the gasAmount for deposit // reusing the gasAmount for deposit
deposit := sdk.NewCoins(coinAmount) deposit := sdk.NewCoins(coinAmount)
txBuilder := suite.CreateTestEIP712SubmitProposal(from, privKey, "ethermint_9000-1", gas, gasAmount, deposit) txBuilder := suite.CreateTestEIP712SubmitProposal(from, privKey, "laconic_9000-1", gas, gasAmount, deposit)
return txBuilder.GetTx() return txBuilder.GetTx()
}, false, false, true, }, false, false, true,
}, },
@ -364,7 +364,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
from, grantee, &banktypes.SendAuthorization{SpendLimit: gasAmount}, &expiresAt, from, grantee, &banktypes.SendAuthorization{SpendLimit: gasAmount}, &expiresAt,
) )
suite.Require().NoError(err) suite.Require().NoError(err)
return suite.CreateTestEIP712CosmosTxBuilder(from, privKey, "ethermint_9000-1", gas, gasAmount, msg).GetTx() return suite.CreateTestEIP712CosmosTxBuilder(from, privKey, "laconic_9000-1", gas, gasAmount, msg).GetTx()
}, false, false, true, }, false, false, true,
}, },
@ -375,7 +375,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20)) coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20))
gasAmount := sdk.NewCoins(coinAmount) gasAmount := sdk.NewCoins(coinAmount)
gas := uint64(200000) gas := uint64(200000)
txBuilder := suite.CreateTestEIP712GrantAllowance(from, privKey, "ethermint_9000-1", gas, gasAmount) txBuilder := suite.CreateTestEIP712GrantAllowance(from, privKey, "laconic_9000-1", gas, gasAmount)
return txBuilder.GetTx() return txBuilder.GetTx()
}, false, false, true, }, false, false, true,
}, },
@ -386,7 +386,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20)) coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20))
amount := sdk.NewCoins(coinAmount) amount := sdk.NewCoins(coinAmount)
gas := uint64(200000) gas := uint64(200000)
txBuilder := suite.CreateTestEIP712MsgEditValidator(from, privKey, "ethermint_9000-1", gas, amount) txBuilder := suite.CreateTestEIP712MsgEditValidator(from, privKey, "laconic_9000-1", gas, amount)
return txBuilder.GetTx() return txBuilder.GetTx()
}, false, false, true, }, false, false, true,
}, },
@ -397,7 +397,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20)) coinAmount := sdk.NewCoin(evmtypes.DefaultEVMDenom, sdk.NewInt(20))
amount := sdk.NewCoins(coinAmount) amount := sdk.NewCoins(coinAmount)
gas := uint64(200000) gas := uint64(200000)
txBuilder := suite.CreateTestEIP712MsgEditValidator(from, privKey, "ethermint_9000-1", gas, amount) txBuilder := suite.CreateTestEIP712MsgEditValidator(from, privKey, "laconic_9000-1", gas, amount)
return txBuilder.GetTx() return txBuilder.GetTx()
}, false, false, true, }, false, false, true,
}, },
@ -407,7 +407,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
from := acc.GetAddress() from := acc.GetAddress()
gas := uint64(200000) gas := uint64(200000)
amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas)))) amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas))))
txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "ethermint_9002-1", gas, amount) txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "laconic_9002-1", gas, amount)
return txBuilder.GetTx() return txBuilder.GetTx()
}, false, false, false, }, false, false, false,
}, },
@ -417,7 +417,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
from := acc.GetAddress() from := acc.GetAddress()
gas := uint64(200000) gas := uint64(200000)
amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas)))) amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas))))
txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "ethermint_9001-1", gas, amount) txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "laconic_9001-1", gas, amount)
txBuilder.SetGasLimit(uint64(300000)) txBuilder.SetGasLimit(uint64(300000))
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(30)))) txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(30))))
return txBuilder.GetTx() return txBuilder.GetTx()
@ -429,7 +429,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
from := acc.GetAddress() from := acc.GetAddress()
gas := uint64(200000) gas := uint64(200000)
amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas)))) amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas))))
txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "ethermint_9001-1", gas, amount) txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "laconic_9001-1", gas, amount)
sigsV2 := signing.SignatureV2{} sigsV2 := signing.SignatureV2{}
txBuilder.SetSignatures(sigsV2) txBuilder.SetSignatures(sigsV2)
return txBuilder.GetTx() return txBuilder.GetTx()
@ -441,7 +441,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
from := acc.GetAddress() from := acc.GetAddress()
gas := uint64(200000) gas := uint64(200000)
amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas)))) amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas))))
txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "ethermint_9001-1", gas, amount) txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "laconic_9001-1", gas, amount)
nonce, err := suite.app.AccountKeeper.GetSequence(suite.ctx, acc.GetAddress()) nonce, err := suite.app.AccountKeeper.GetSequence(suite.ctx, acc.GetAddress())
suite.Require().NoError(err) suite.Require().NoError(err)
sigsV2 := signing.SignatureV2{ sigsV2 := signing.SignatureV2{
@ -461,7 +461,7 @@ func (suite AnteTestSuite) TestAnteHandler() {
from := acc.GetAddress() from := acc.GetAddress()
gas := uint64(200000) gas := uint64(200000)
amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas)))) amount := sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100*int64(gas))))
txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "ethermint_9001-1", gas, amount) txBuilder := suite.CreateTestEIP712TxBuilderMsgSend(from, privKey, "laconic_9001-1", gas, amount)
nonce, err := suite.app.AccountKeeper.GetSequence(suite.ctx, acc.GetAddress()) nonce, err := suite.app.AccountKeeper.GetSequence(suite.ctx, acc.GetAddress())
suite.Require().NoError(err) suite.Require().NoError(err)
sigsV2 := signing.SignatureV2{ sigsV2 := signing.SignatureV2{

View File

@ -15,7 +15,7 @@ import (
"github.com/cerc-io/laconicd/crypto/ethsecp256k1" "github.com/cerc-io/laconicd/crypto/ethsecp256k1"
"github.com/cerc-io/laconicd/ethereum/eip712" "github.com/cerc-io/laconicd/ethereum/eip712"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
ethcrypto "github.com/ethereum/go-ethereum/crypto" ethcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/secp256k1" "github.com/ethereum/go-ethereum/crypto/secp256k1"
@ -25,7 +25,7 @@ var ethermintCodec codec.ProtoCodecMarshaler
func init() { func init() {
registry := codectypes.NewInterfaceRegistry() registry := codectypes.NewInterfaceRegistry()
ethermint.RegisterInterfaces(registry) laconicd.RegisterInterfaces(registry)
ethermintCodec = codec.NewProtoCodec(registry) ethermintCodec = codec.NewProtoCodec(registry)
} }
@ -178,7 +178,7 @@ func VerifySignature(
msgs, tx.GetMemo(), tx.GetTip(), msgs, tx.GetMemo(), tx.GetTip(),
) )
signerChainID, err := ethermint.ParseChainID(signerData.ChainID) signerChainID, err := laconicd.ParseChainID(signerData.ChainID)
if err != nil { if err != nil {
return sdkerrors.Wrapf(err, "failed to parse chainID: %s", signerData.ChainID) return sdkerrors.Wrapf(err, "failed to parse chainID: %s", signerData.ChainID)
} }
@ -192,7 +192,7 @@ func VerifySignature(
return sdkerrors.Wrap(sdkerrors.ErrUnknownExtensionOptions, "tx doesnt contain expected amount of extension options") return sdkerrors.Wrap(sdkerrors.ErrUnknownExtensionOptions, "tx doesnt contain expected amount of extension options")
} }
extOpt, ok := opts[0].GetCachedValue().(*ethermint.ExtensionOptionsWeb3Tx) extOpt, ok := opts[0].GetCachedValue().(*laconicd.ExtensionOptionsWeb3Tx)
if !ok { if !ok {
return sdkerrors.Wrap(sdkerrors.ErrInvalidChainID, "unknown extension option") return sdkerrors.Wrap(sdkerrors.ErrInvalidChainID, "unknown extension option")
} }

View File

@ -12,7 +12,7 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
authante "github.com/cosmos/cosmos-sdk/x/auth/ante" authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmkeeper "github.com/cerc-io/laconicd/x/evm/keeper" evmkeeper "github.com/cerc-io/laconicd/x/evm/keeper"
"github.com/cerc-io/laconicd/x/evm/statedb" "github.com/cerc-io/laconicd/x/evm/statedb"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
@ -236,7 +236,7 @@ func (egcd EthGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula
ctx.EventManager().EmitEvents(events) ctx.EventManager().EmitEvents(events)
// TODO: deprecate after https://github.com/cosmos/cosmos-sdk/issues/9514 is fixed on SDK // TODO: deprecate after https://github.com/cosmos/cosmos-sdk/issues/9514 is fixed on SDK
blockGasLimit := ethermint.BlockGasLimit(ctx) blockGasLimit := laconicd.BlockGasLimit(ctx)
// NOTE: safety check // NOTE: safety check
if blockGasLimit > 0 { if blockGasLimit > 0 {
@ -248,7 +248,7 @@ func (egcd EthGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula
// Set ctx.GasMeter with a limit of GasWanted (gasLimit) // Set ctx.GasMeter with a limit of GasWanted (gasLimit)
gasConsumed := ctx.GasMeter().GasConsumed() gasConsumed := ctx.GasMeter().GasConsumed()
ctx = ctx.WithGasMeter(ethermint.NewInfiniteGasMeterWithLimit(gasWanted)) ctx = ctx.WithGasMeter(laconicd.NewInfiniteGasMeterWithLimit(gasWanted))
ctx.GasMeter().ConsumeGas(gasConsumed, "copy gas consumed") ctx.GasMeter().ConsumeGas(gasConsumed, "copy gas consumed")
newCtx := ctx.WithPriority(minPriority) newCtx := ctx.WithPriority(minPriority)

View File

@ -6,7 +6,7 @@ import (
sdkmath "cosmossdk.io/math" sdkmath "cosmossdk.io/math"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
@ -49,7 +49,7 @@ func NewDynamicFeeChecker(k DynamicFeeEVMKeeper) authante.TxFeeChecker {
// get the priority tip cap from the extension option. // get the priority tip cap from the extension option.
if hasExtOptsTx, ok := tx.(authante.HasExtensionOptionsTx); ok { if hasExtOptsTx, ok := tx.(authante.HasExtensionOptionsTx); ok {
for _, opt := range hasExtOptsTx.GetExtensionOptions() { for _, opt := range hasExtOptsTx.GetExtensionOptions() {
if extOpt, ok := opt.GetCachedValue().(*ethermint.ExtensionOptionDynamicFeeTx); ok { if extOpt, ok := opt.GetCachedValue().(*laconicd.ExtensionOptionDynamicFeeTx); ok {
maxPriorityPrice = extOpt.MaxPriorityPrice maxPriorityPrice = extOpt.MaxPriorityPrice
break break
} }

View File

@ -7,7 +7,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/cerc-io/laconicd/encoding" "github.com/cerc-io/laconicd/encoding"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
codectypes "github.com/cosmos/cosmos-sdk/codec/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types"
@ -172,7 +172,7 @@ func TestSDKTxFeeChecker(t *testing.T) {
txBuilder.SetGasLimit(1) txBuilder.SetGasLimit(1)
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("aphoton", sdk.NewInt(10).Mul(types.DefaultPriorityReduction)))) txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("aphoton", sdk.NewInt(10).Mul(types.DefaultPriorityReduction))))
option, err := codectypes.NewAnyWithValue(&ethermint.ExtensionOptionDynamicFeeTx{}) option, err := codectypes.NewAnyWithValue(&laconicd.ExtensionOptionDynamicFeeTx{})
require.NoError(t, err) require.NoError(t, err)
txBuilder.SetExtensionOptions(option) txBuilder.SetExtensionOptions(option)
return txBuilder.GetTx() return txBuilder.GetTx()
@ -192,7 +192,7 @@ func TestSDKTxFeeChecker(t *testing.T) {
txBuilder.SetGasLimit(1) txBuilder.SetGasLimit(1)
txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("aphoton", sdk.NewInt(10).Mul(types.DefaultPriorityReduction).Add(sdk.NewInt(10))))) txBuilder.SetFeeAmount(sdk.NewCoins(sdk.NewCoin("aphoton", sdk.NewInt(10).Mul(types.DefaultPriorityReduction).Add(sdk.NewInt(10)))))
option, err := codectypes.NewAnyWithValue(&ethermint.ExtensionOptionDynamicFeeTx{ option, err := codectypes.NewAnyWithValue(&laconicd.ExtensionOptionDynamicFeeTx{
MaxPriorityPrice: sdk.NewInt(5).Mul(types.DefaultPriorityReduction), MaxPriorityPrice: sdk.NewInt(5).Mul(types.DefaultPriorityReduction),
}) })
require.NoError(t, err) require.NoError(t, err)

View File

@ -55,7 +55,7 @@ type AnteTestSuite struct {
suite.Suite suite.Suite
ctx sdk.Context ctx sdk.Context
app *app.EthermintApp app *app.LaconicApp
clientCtx client.Context clientCtx client.Context
anteHandler sdk.AnteHandler anteHandler sdk.AnteHandler
ethSigner ethtypes.Signer ethSigner ethtypes.Signer
@ -73,7 +73,7 @@ func (suite *AnteTestSuite) StateDB() *statedb.StateDB {
func (suite *AnteTestSuite) SetupTest() { func (suite *AnteTestSuite) SetupTest() {
checkTx := false checkTx := false
suite.app = app.Setup(checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState { suite.app = app.Setup(checkTx, func(app *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
if suite.enableFeemarket { if suite.enableFeemarket {
// setup feemarketGenesis params // setup feemarketGenesis params
feemarketGenesis := feemarkettypes.DefaultGenesisState() feemarketGenesis := feemarkettypes.DefaultGenesisState()
@ -100,7 +100,7 @@ func (suite *AnteTestSuite) SetupTest() {
return genesis return genesis
}) })
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 2, ChainID: "ethermint_9000-1", Time: time.Now().UTC()}) suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{Height: 2, ChainID: "laconic_9000-1", Time: time.Now().UTC()})
suite.ctx = suite.ctx.WithMinGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(evmtypes.DefaultEVMDenom, sdk.OneInt()))) suite.ctx = suite.ctx.WithMinGasPrices(sdk.NewDecCoins(sdk.NewDecCoin(evmtypes.DefaultEVMDenom, sdk.OneInt())))
suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(1000000000000000000)) suite.ctx = suite.ctx.WithBlockGasMeter(sdk.NewGasMeter(1000000000000000000))
suite.app.EvmKeeper.WithChainID(suite.ctx) suite.app.EvmKeeper.WithChainID(suite.ctx)

View File

@ -102,7 +102,7 @@ import (
"github.com/cerc-io/laconicd/app/ante" "github.com/cerc-io/laconicd/app/ante"
srvflags "github.com/cerc-io/laconicd/server/flags" srvflags "github.com/cerc-io/laconicd/server/flags"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm" "github.com/cerc-io/laconicd/x/evm"
evmkeeper "github.com/cerc-io/laconicd/x/evm/keeper" evmkeeper "github.com/cerc-io/laconicd/x/evm/keeper"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
@ -199,14 +199,14 @@ var (
} }
) )
var _ simapp.App = (*EthermintApp)(nil) var _ simapp.App = (*LaconicApp)(nil)
// var _ server.Application (*EthermintApp)(nil) // var _ server.Application (*LaconicApp)(nil)
// EthermintApp implements an extended ABCI application. It is an application // LaconicApp implements an extended ABCI application. It is an application
// that may process transactions through Ethereum's EVM running atop of // that may process transactions through Ethereum's EVM running atop of
// Tendermint consensus. // Tendermint consensus.
type EthermintApp struct { type LaconicApp struct {
*baseapp.BaseApp *baseapp.BaseApp
// encoding // encoding
@ -263,8 +263,8 @@ type EthermintApp struct {
configurator module.Configurator configurator module.Configurator
} }
// NewEthermintApp returns a reference to a new initialized Ethermint application. // NewLaconicApp returns a reference to a new initialized Ethermint application.
func NewEthermintApp( func NewLaconicApp(
logger log.Logger, logger log.Logger,
db dbm.DB, db dbm.DB,
traceStore io.Writer, traceStore io.Writer,
@ -275,7 +275,7 @@ func NewEthermintApp(
encodingConfig simappparams.EncodingConfig, encodingConfig simappparams.EncodingConfig,
appOpts servertypes.AppOptions, appOpts servertypes.AppOptions,
baseAppOptions ...func(*baseapp.BaseApp), baseAppOptions ...func(*baseapp.BaseApp),
) *EthermintApp { ) *LaconicApp {
appCodec := encodingConfig.Codec appCodec := encodingConfig.Codec
cdc := encodingConfig.Amino cdc := encodingConfig.Amino
interfaceRegistry := encodingConfig.InterfaceRegistry interfaceRegistry := encodingConfig.InterfaceRegistry
@ -313,7 +313,7 @@ func NewEthermintApp(
tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey, evmtypes.TransientKey, feemarkettypes.TransientKey)
memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) memKeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey)
app := &EthermintApp{ app := &LaconicApp{
BaseApp: bApp, BaseApp: bApp,
cdc: cdc, cdc: cdc,
appCodec: appCodec, appCodec: appCodec,
@ -343,7 +343,7 @@ func NewEthermintApp(
app.AccountKeeper = authkeeper.NewAccountKeeper( app.AccountKeeper = authkeeper.NewAccountKeeper(
appCodec, keys[authtypes.StoreKey], appCodec, keys[authtypes.StoreKey],
app.GetSubspace(authtypes.ModuleName), app.GetSubspace(authtypes.ModuleName),
ethermint.ProtoAccount, laconicd.ProtoAccount,
maccPerms, maccPerms,
sdk.GetConfig().GetBech32AccountAddrPrefix(), sdk.GetConfig().GetBech32AccountAddrPrefix(),
) )
@ -707,7 +707,7 @@ func NewEthermintApp(
} }
// use Ethermint's custom AnteHandler // use Ethermint's custom AnteHandler
func (app *EthermintApp) setAnteHandler(txConfig client.TxConfig, maxGasWanted uint64) { func (app *LaconicApp) setAnteHandler(txConfig client.TxConfig, maxGasWanted uint64) {
anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{ anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{
AccountKeeper: app.AccountKeeper, AccountKeeper: app.AccountKeeper,
BankKeeper: app.BankKeeper, BankKeeper: app.BankKeeper,
@ -726,7 +726,7 @@ func (app *EthermintApp) setAnteHandler(txConfig client.TxConfig, maxGasWanted u
app.SetAnteHandler(anteHandler) app.SetAnteHandler(anteHandler)
} }
func (app *EthermintApp) setPostHandler() { func (app *LaconicApp) setPostHandler() {
postHandler, err := posthandler.NewPostHandler( postHandler, err := posthandler.NewPostHandler(
posthandler.HandlerOptions{}, posthandler.HandlerOptions{},
) )
@ -738,20 +738,20 @@ func (app *EthermintApp) setPostHandler() {
} }
// Name returns the name of the App // Name returns the name of the App
func (app *EthermintApp) Name() string { return app.BaseApp.Name() } func (app *LaconicApp) Name() string { return app.BaseApp.Name() }
// BeginBlocker updates every begin block // BeginBlocker updates every begin block
func (app *EthermintApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { func (app *LaconicApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
return app.mm.BeginBlock(ctx, req) return app.mm.BeginBlock(ctx, req)
} }
// EndBlocker updates every end block // EndBlocker updates every end block
func (app *EthermintApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { func (app *LaconicApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock {
return app.mm.EndBlock(ctx, req) return app.mm.EndBlock(ctx, req)
} }
// InitChainer updates at chain initialization // InitChainer updates at chain initialization
func (app *EthermintApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain { func (app *LaconicApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain) abci.ResponseInitChain {
var genesisState simapp.GenesisState var genesisState simapp.GenesisState
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil { if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
panic(err) panic(err)
@ -761,12 +761,12 @@ func (app *EthermintApp) InitChainer(ctx sdk.Context, req abci.RequestInitChain)
} }
// LoadHeight loads state at a particular height // LoadHeight loads state at a particular height
func (app *EthermintApp) LoadHeight(height int64) error { func (app *LaconicApp) LoadHeight(height int64) error {
return app.LoadVersion(height) return app.LoadVersion(height)
} }
// ModuleAccountAddrs returns all the app's module account addresses. // ModuleAccountAddrs returns all the app's module account addresses.
func (app *EthermintApp) ModuleAccountAddrs() map[string]bool { func (app *LaconicApp) ModuleAccountAddrs() map[string]bool {
modAccAddrs := make(map[string]bool) modAccAddrs := make(map[string]bool)
// #nosec G705 // #nosec G705
for acc := range maccPerms { for acc := range maccPerms {
@ -778,7 +778,7 @@ func (app *EthermintApp) ModuleAccountAddrs() map[string]bool {
// BlockedAddrs returns all the app's module account addresses that are not // BlockedAddrs returns all the app's module account addresses that are not
// allowed to receive external tokens. // allowed to receive external tokens.
func (app *EthermintApp) BlockedAddrs() map[string]bool { func (app *LaconicApp) BlockedAddrs() map[string]bool {
blockedAddrs := make(map[string]bool) blockedAddrs := make(map[string]bool)
// #nosec G705 // #nosec G705
for acc := range maccPerms { for acc := range maccPerms {
@ -788,64 +788,64 @@ func (app *EthermintApp) BlockedAddrs() map[string]bool {
return blockedAddrs return blockedAddrs
} }
// LegacyAmino returns EthermintApp's amino codec. // LegacyAmino returns LaconicApp's amino codec.
// //
// NOTE: This is solely to be used for testing purposes as it may be desirable // NOTE: This is solely to be used for testing purposes as it may be desirable
// for modules to register their own custom testing types. // for modules to register their own custom testing types.
func (app *EthermintApp) LegacyAmino() *codec.LegacyAmino { func (app *LaconicApp) LegacyAmino() *codec.LegacyAmino {
return app.cdc return app.cdc
} }
// AppCodec returns EthermintApp's app codec. // AppCodec returns LaconicApp's app codec.
// //
// NOTE: This is solely to be used for testing purposes as it may be desirable // NOTE: This is solely to be used for testing purposes as it may be desirable
// for modules to register their own custom testing types. // for modules to register their own custom testing types.
func (app *EthermintApp) AppCodec() codec.Codec { func (app *LaconicApp) AppCodec() codec.Codec {
return app.appCodec return app.appCodec
} }
// InterfaceRegistry returns EthermintApp's InterfaceRegistry // InterfaceRegistry returns LaconicApp's InterfaceRegistry
func (app *EthermintApp) InterfaceRegistry() types.InterfaceRegistry { func (app *LaconicApp) InterfaceRegistry() types.InterfaceRegistry {
return app.interfaceRegistry return app.interfaceRegistry
} }
// GetKey returns the KVStoreKey for the provided store key. // GetKey returns the KVStoreKey for the provided store key.
// //
// NOTE: This is solely to be used for testing purposes. // NOTE: This is solely to be used for testing purposes.
func (app *EthermintApp) GetKey(storeKey string) *storetypes.KVStoreKey { func (app *LaconicApp) GetKey(storeKey string) *storetypes.KVStoreKey {
return app.keys[storeKey] return app.keys[storeKey]
} }
// GetTKey returns the TransientStoreKey for the provided store key. // GetTKey returns the TransientStoreKey for the provided store key.
// //
// NOTE: This is solely to be used for testing purposes. // NOTE: This is solely to be used for testing purposes.
func (app *EthermintApp) GetTKey(storeKey string) *storetypes.TransientStoreKey { func (app *LaconicApp) GetTKey(storeKey string) *storetypes.TransientStoreKey {
return app.tkeys[storeKey] return app.tkeys[storeKey]
} }
// GetMemKey returns the MemStoreKey for the provided mem key. // GetMemKey returns the MemStoreKey for the provided mem key.
// //
// NOTE: This is solely used for testing purposes. // NOTE: This is solely used for testing purposes.
func (app *EthermintApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey { func (app *LaconicApp) GetMemKey(storeKey string) *storetypes.MemoryStoreKey {
return app.memKeys[storeKey] return app.memKeys[storeKey]
} }
// GetSubspace returns a param subspace for a given module name. // GetSubspace returns a param subspace for a given module name.
// //
// NOTE: This is solely to be used for testing purposes. // NOTE: This is solely to be used for testing purposes.
func (app *EthermintApp) GetSubspace(moduleName string) paramstypes.Subspace { func (app *LaconicApp) GetSubspace(moduleName string) paramstypes.Subspace {
subspace, _ := app.ParamsKeeper.GetSubspace(moduleName) subspace, _ := app.ParamsKeeper.GetSubspace(moduleName)
return subspace return subspace
} }
// SimulationManager implements the SimulationApp interface // SimulationManager implements the SimulationApp interface
func (app *EthermintApp) SimulationManager() *module.SimulationManager { func (app *LaconicApp) SimulationManager() *module.SimulationManager {
return app.sm return app.sm
} }
// RegisterAPIRoutes registers all application module routes with the provided // RegisterAPIRoutes registers all application module routes with the provided
// API server. // API server.
func (app *EthermintApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) { func (app *LaconicApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {
clientCtx := apiSvr.ClientCtx clientCtx := apiSvr.ClientCtx
// Register new tx routes from grpc-gateway. // Register new tx routes from grpc-gateway.
authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter) authtx.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)
@ -862,12 +862,12 @@ func (app *EthermintApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.
} }
// RegisterTxService implements the Application.RegisterTxService method. // RegisterTxService implements the Application.RegisterTxService method.
func (app *EthermintApp) RegisterTxService(clientCtx client.Context) { func (app *LaconicApp) RegisterTxService(clientCtx client.Context) {
authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry)
} }
// RegisterTendermintService implements the Application.RegisterTendermintService method. // RegisterTendermintService implements the Application.RegisterTendermintService method.
func (app *EthermintApp) RegisterTendermintService(clientCtx client.Context) { func (app *LaconicApp) RegisterTendermintService(clientCtx client.Context) {
tmservice.RegisterTendermintService( tmservice.RegisterTendermintService(
clientCtx, clientCtx,
app.BaseApp.GRPCQueryRouter(), app.BaseApp.GRPCQueryRouter(),

View File

@ -14,13 +14,13 @@ import (
"github.com/cerc-io/laconicd/encoding" "github.com/cerc-io/laconicd/encoding"
) )
func TestEthermintAppExport(t *testing.T) { func TestLaconicAppExport(t *testing.T) {
db := dbm.NewMemDB() db := dbm.NewMemDB()
app := SetupWithDB(false, nil, db) app := SetupWithDB(false, nil, db)
app.Commit() app.Commit()
// Making a new app object with the db, so that initchain hasn't been called // Making a new app object with the db, so that initchain hasn't been called
app2 := NewEthermintApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{}) app2 := NewLaconicApp(log.NewTMLogger(log.NewSyncWriter(os.Stdout)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{})
_, err := app2.ExportAppStateAndValidators(false, []string{}) _, err := app2.ExportAppStateAndValidators(false, []string{})
require.NoError(t, err, "ExportAppStateAndValidators should not have an error") require.NoError(t, err, "ExportAppStateAndValidators should not have an error")
} }

View File

@ -12,9 +12,9 @@ import (
dbm "github.com/tendermint/tm-db" dbm "github.com/tendermint/tm-db"
) )
func BenchmarkEthermintApp_ExportAppStateAndValidators(b *testing.B) { func BenchmarkLaconicApp_ExportAppStateAndValidators(b *testing.B) {
db := dbm.NewMemDB() db := dbm.NewMemDB()
app := NewEthermintApp(log.NewTMLogger(io.Discard), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{}) app := NewLaconicApp(log.NewTMLogger(io.Discard), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{})
genesisState := NewTestGenesisState(app.AppCodec()) genesisState := NewTestGenesisState(app.AppCodec())
stateBytes, err := json.MarshalIndent(genesisState, "", " ") stateBytes, err := json.MarshalIndent(genesisState, "", " ")
@ -25,7 +25,7 @@ func BenchmarkEthermintApp_ExportAppStateAndValidators(b *testing.B) {
// Initialize the chain // Initialize the chain
app.InitChain( app.InitChain(
abci.RequestInitChain{ abci.RequestInitChain{
ChainId: "ethermint_9000-1", ChainId: "laconic_9000-1",
Validators: []abci.ValidatorUpdate{}, Validators: []abci.ValidatorUpdate{},
AppStateBytes: stateBytes, AppStateBytes: stateBytes,
}, },
@ -36,7 +36,7 @@ func BenchmarkEthermintApp_ExportAppStateAndValidators(b *testing.B) {
b.ReportAllocs() b.ReportAllocs()
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
// Making a new app object with the db, so that initchain hasn't been called // Making a new app object with the db, so that initchain hasn't been called
app2 := NewEthermintApp(log.NewTMLogger(log.NewSyncWriter(io.Discard)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{}) app2 := NewLaconicApp(log.NewTMLogger(log.NewSyncWriter(io.Discard)), db, nil, true, map[int64]bool{}, DefaultNodeHome, 0, encoding.MakeConfig(ModuleBasics), simapp.EmptyAppOptions{})
if _, err := app2.ExportAppStateAndValidators(false, []string{}); err != nil { if _, err := app2.ExportAppStateAndValidators(false, []string{}); err != nil {
b.Fatal(err) b.Fatal(err)
} }

View File

@ -24,7 +24,7 @@ func NewDefaultGenesisState() simapp.GenesisState {
// ExportAppStateAndValidators exports the state of the application for a genesis // ExportAppStateAndValidators exports the state of the application for a genesis
// file. // file.
func (app *EthermintApp) ExportAppStateAndValidators( func (app *LaconicApp) ExportAppStateAndValidators(
forZeroHeight bool, jailAllowedAddrs []string, forZeroHeight bool, jailAllowedAddrs []string,
) (servertypes.ExportedApp, error) { ) (servertypes.ExportedApp, error) {
// Creates context with current height and checks txs for ctx to be usable by start of next block // Creates context with current height and checks txs for ctx to be usable by start of next block
@ -63,7 +63,7 @@ func (app *EthermintApp) ExportAppStateAndValidators(
// prepare for fresh start at zero height // prepare for fresh start at zero height
// NOTE zero height genesis is a temporary feature which will be deprecated // NOTE zero height genesis is a temporary feature which will be deprecated
// in favor of export at a block height // in favor of export at a block height
func (app *EthermintApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) error { func (app *LaconicApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) error {
applyAllowedAddrs := false applyAllowedAddrs := false
// check if there is a allowed address list // check if there is a allowed address list

View File

@ -64,9 +64,9 @@ func fauxMerkleModeOpt(bapp *baseapp.BaseApp) {
} }
// NewSimApp disable feemarket on native tx, otherwise the cosmos-sdk simulation tests will fail. // NewSimApp disable feemarket on native tx, otherwise the cosmos-sdk simulation tests will fail.
func NewSimApp(logger log.Logger, db dbm.DB) (*EthermintApp, error) { func NewSimApp(logger log.Logger, db dbm.DB) (*LaconicApp, error) {
encodingConfig := MakeEncodingConfig() encodingConfig := MakeEncodingConfig()
app := NewEthermintApp(logger, db, nil, false, map[int64]bool{}, DefaultNodeHome, simapp.FlagPeriodValue, encodingConfig, simapp.EmptyAppOptions{}, fauxMerkleModeOpt) app := NewLaconicApp(logger, db, nil, false, map[int64]bool{}, DefaultNodeHome, simapp.FlagPeriodValue, encodingConfig, simapp.EmptyAppOptions{}, fauxMerkleModeOpt)
// disable feemarket on native tx // disable feemarket on native tx
anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{ anteHandler, err := ante.NewAnteHandler(ante.HandlerOptions{
AccountKeeper: app.AccountKeeper, AccountKeeper: app.AccountKeeper,

View File

@ -6,7 +6,7 @@ import (
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
) )
func (app *EthermintApp) RegisterUpgradeHandlers() { func (app *LaconicApp) RegisterUpgradeHandlers() {
planName := "integration-test-upgrade" planName := "integration-test-upgrade"
app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { app.UpgradeKeeper.SetUpgradeHandler(planName, func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
return app.mm.RunMigrations(ctx, app.configurator, fromVM) return app.mm.RunMigrations(ctx, app.configurator, fromVM)

View File

@ -17,7 +17,7 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cerc-io/laconicd/encoding" "github.com/cerc-io/laconicd/encoding"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
"github.com/cerc-io/laconicd/crypto/ethsecp256k1" "github.com/cerc-io/laconicd/crypto/ethsecp256k1"
@ -34,7 +34,7 @@ import (
) )
// DefaultConsensusParams defines the default Tendermint consensus params used in // DefaultConsensusParams defines the default Tendermint consensus params used in
// EthermintApp testing. // LaconicApp testing.
var DefaultConsensusParams = &abci.ConsensusParams{ var DefaultConsensusParams = &abci.ConsensusParams{
Block: &abci.BlockParams{ Block: &abci.BlockParams{
MaxBytes: 200000, MaxBytes: 200000,
@ -52,14 +52,14 @@ var DefaultConsensusParams = &abci.ConsensusParams{
}, },
} }
// Setup initializes a new EthermintApp. A Nop logger is set in EthermintApp. // Setup initializes a new LaconicApp. A Nop logger is set in LaconicApp.
func Setup(isCheckTx bool, patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState) *EthermintApp { func Setup(isCheckTx bool, patchGenesis func(*LaconicApp, simapp.GenesisState) simapp.GenesisState) *LaconicApp {
return SetupWithDB(isCheckTx, patchGenesis, dbm.NewMemDB()) return SetupWithDB(isCheckTx, patchGenesis, dbm.NewMemDB())
} }
// SetupWithDB initializes a new EthermintApp. A Nop logger is set in EthermintApp. // SetupWithDB initializes a new LaconicApp. A Nop logger is set in LaconicApp.
func SetupWithDB(isCheckTx bool, patchGenesis func(*EthermintApp, simapp.GenesisState) simapp.GenesisState, db dbm.DB) *EthermintApp { func SetupWithDB(isCheckTx bool, patchGenesis func(*LaconicApp, simapp.GenesisState) simapp.GenesisState, db dbm.DB) *LaconicApp {
app := NewEthermintApp(log.NewNopLogger(), app := NewLaconicApp(log.NewNopLogger(),
db, db,
nil, nil,
true, true,
@ -83,7 +83,7 @@ func SetupWithDB(isCheckTx bool, patchGenesis func(*EthermintApp, simapp.Genesis
// Initialize the chain // Initialize the chain
app.InitChain( app.InitChain(
abci.RequestInitChain{ abci.RequestInitChain{
ChainId: "ethermint_9000-1", ChainId: "laconic_9000-1",
Validators: []abci.ValidatorUpdate{}, Validators: []abci.ValidatorUpdate{},
ConsensusParams: DefaultConsensusParams, ConsensusParams: DefaultConsensusParams,
AppStateBytes: stateBytes, AppStateBytes: stateBytes,
@ -102,7 +102,7 @@ func RandomGenesisAccounts(simState *module.SimulationState) authtypes.GenesisAc
for i, acc := range simState.Accounts { for i, acc := range simState.Accounts {
bacc := authtypes.NewBaseAccountWithAddress(acc.Address) bacc := authtypes.NewBaseAccountWithAddress(acc.Address)
ethacc := &ethermint.EthAccount{ ethacc := &laconicd.EthAccount{
BaseAccount: bacc, BaseAccount: bacc,
CodeHash: common.BytesToHash(emptyCodeHash).String(), CodeHash: common.BytesToHash(emptyCodeHash).String(),
} }

View File

@ -17,7 +17,7 @@ import (
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
"github.com/cerc-io/laconicd/crypto/ethsecp256k1" "github.com/cerc-io/laconicd/crypto/ethsecp256k1"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cosmos/cosmos-sdk/simapp" "github.com/cosmos/cosmos-sdk/simapp"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
@ -40,7 +40,7 @@ func TestRandomGenesisAccounts(t *testing.T) {
subSpace, find := paramsKeeper.GetSubspace(authtypes.ModuleName) subSpace, find := paramsKeeper.GetSubspace(authtypes.ModuleName)
require.True(t, find) require.True(t, find)
accountKeeper := authkeeper.NewAccountKeeper( accountKeeper := authkeeper.NewAccountKeeper(
appCodec, sdk.NewKVStoreKey(authtypes.StoreKey), subSpace, ethermint.ProtoAccount, maccPerms, sdk.GetConfig().GetBech32AccountAddrPrefix(), appCodec, sdk.NewKVStoreKey(authtypes.StoreKey), subSpace, laconicd.ProtoAccount, maccPerms, sdk.GetConfig().GetBech32AccountAddrPrefix(),
) )
authModule := auth.NewAppModule(appCodec, accountKeeper, RandomGenesisAccounts) authModule := auth.NewAppModule(appCodec, accountKeeper, RandomGenesisAccounts)
@ -56,7 +56,7 @@ func TestRandomGenesisAccounts(t *testing.T) {
accounts, err := authtypes.UnpackAccounts(authState.Accounts) accounts, err := authtypes.UnpackAccounts(authState.Accounts)
require.NoError(t, err) require.NoError(t, err)
for _, acc := range accounts { for _, acc := range accounts {
_, ok := acc.(ethermint.EthAccountI) _, ok := acc.(laconicd.EthAccountI)
require.True(t, ok) require.True(t, ok)
} }
} }
@ -76,7 +76,7 @@ func TestStateFn(t *testing.T) {
require.NoError(t, os.RemoveAll(dir)) require.NoError(t, os.RemoveAll(dir))
}() }()
app := NewEthermintApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, simapp.FlagPeriodValue, MakeEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt) app := NewLaconicApp(logger, db, nil, true, map[int64]bool{}, DefaultNodeHome, simapp.FlagPeriodValue, MakeEncodingConfig(), simapp.EmptyAppOptions{}, fauxMerkleModeOpt)
require.Equal(t, appName, app.Name()) require.Equal(t, appName, app.Name())
appStateFn := StateFn(app.AppCodec(), app.SimulationManager()) appStateFn := StateFn(app.AppCodec(), app.SimulationManager())

View File

@ -12,7 +12,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/flags"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
// InitConfig adds the chain-id, encoding and output flags to the persistent flag set. // InitConfig adds the chain-id, encoding and output flags to the persistent flag set.
@ -57,7 +57,7 @@ func ValidateChainID(baseCmd *cobra.Command) *cobra.Command {
validateFn := func(cmd *cobra.Command, args []string) error { validateFn := func(cmd *cobra.Command, args []string) error {
chainID, _ := cmd.Flags().GetString(flags.FlagChainID) chainID, _ := cmd.Flags().GetString(flags.FlagChainID)
if !ethermint.IsValidChainID(chainID) { if !laconicd.IsValidChainID(chainID) {
return fmt.Errorf("invalid chain-id format: %s", chainID) return fmt.Errorf("invalid chain-id format: %s", chainID)
} }

View File

@ -7,7 +7,7 @@ import (
"fmt" "fmt"
"sort" "sort"
etherminthd "github.com/cerc-io/laconicd/crypto/hd" laconicdhd "github.com/cerc-io/laconicd/crypto/hd"
bip39 "github.com/cosmos/go-bip39" bip39 "github.com/cosmos/go-bip39"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -68,7 +68,7 @@ func RunAddCmd(ctx client.Context, cmd *cobra.Command, args []string, inBuf *buf
if dryRun, _ := cmd.Flags().GetBool(flags.FlagDryRun); dryRun { if dryRun, _ := cmd.Flags().GetBool(flags.FlagDryRun); dryRun {
// use in memory keybase // use in memory keybase
kb = keyring.NewInMemory(ctx.Codec, etherminthd.EthSecp256k1Option()) kb = keyring.NewInMemory(ctx.Codec, laconicdhd.EthSecp256k1Option())
} else { } else {
_, err = kb.Key(name) _, err = kb.Key(name)
if err == nil { if err == nil {

View File

@ -41,7 +41,7 @@ import (
"github.com/cerc-io/laconicd/crypto/hd" "github.com/cerc-io/laconicd/crypto/hd"
"github.com/cerc-io/laconicd/server/config" "github.com/cerc-io/laconicd/server/config"
srvflags "github.com/cerc-io/laconicd/server/flags" srvflags "github.com/cerc-io/laconicd/server/flags"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
"github.com/cerc-io/laconicd/testutil/network" "github.com/cerc-io/laconicd/testutil/network"
@ -91,7 +91,7 @@ func addTestnetFlagsToCmd(cmd *cobra.Command) {
cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created") cmd.Flags().String(flags.FlagChainID, "", "genesis file chain-id, if left blank will be randomly created")
cmd.Flags().String(sdkserver.FlagMinGasPrices, cmd.Flags().String(sdkserver.FlagMinGasPrices,
fmt.Sprintf("0.000006%s", fmt.Sprintf("0.000006%s",
ethermint.AttoPhoton), laconicd.AttoPhoton),
"Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)") "Minimum gas prices to accept for transactions; All fees in a tx must meet this minimum (e.g. 0.01photino,0.001stake)")
cmd.Flags().String(flags.FlagKeyAlgorithm, string(hd.EthSecp256k1Type), "Key signing algorithm to generate keys for") cmd.Flags().String(flags.FlagKeyAlgorithm, string(hd.EthSecp256k1Type), "Key signing algorithm to generate keys for")
} }
@ -215,7 +215,7 @@ func initTestnetFiles(
args initArgs, args initArgs,
) error { ) error {
if args.chainID == "" { if args.chainID == "" {
args.chainID = fmt.Sprintf("ethermint_%d-1", tmrand.Int63n(9999999999999)+1) args.chainID = fmt.Sprintf("laconic_%d-1", tmrand.Int63n(9999999999999)+1)
} }
nodeIDs := make([]string, args.numValidators) nodeIDs := make([]string, args.numValidators)
@ -296,22 +296,22 @@ func initTestnetFiles(
return err return err
} }
accStakingTokens := sdk.TokensFromConsensusPower(5000, ethermint.PowerReduction) accStakingTokens := sdk.TokensFromConsensusPower(5000, laconicd.PowerReduction)
coins := sdk.Coins{ coins := sdk.Coins{
sdk.NewCoin(ethermint.AttoPhoton, accStakingTokens), sdk.NewCoin(laconicd.AttoPhoton, accStakingTokens),
} }
genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: coins.Sort()}) genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: coins.Sort()})
genAccounts = append(genAccounts, &ethermint.EthAccount{ genAccounts = append(genAccounts, &laconicd.EthAccount{
BaseAccount: authtypes.NewBaseAccount(addr, nil, 0, 0), BaseAccount: authtypes.NewBaseAccount(addr, nil, 0, 0),
CodeHash: common.BytesToHash(evmtypes.EmptyCodeHash).Hex(), CodeHash: common.BytesToHash(evmtypes.EmptyCodeHash).Hex(),
}) })
valTokens := sdk.TokensFromConsensusPower(100, ethermint.PowerReduction) valTokens := sdk.TokensFromConsensusPower(100, laconicd.PowerReduction)
createValMsg, err := stakingtypes.NewMsgCreateValidator( createValMsg, err := stakingtypes.NewMsgCreateValidator(
sdk.ValAddress(addr), sdk.ValAddress(addr),
valPubKeys[i], valPubKeys[i],
sdk.NewCoin(ethermint.AttoPhoton, valTokens), sdk.NewCoin(laconicd.AttoPhoton, valTokens),
stakingtypes.NewDescription(nodeDirName, "", "", "", ""), stakingtypes.NewDescription(nodeDirName, "", "", "", ""),
stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()), stakingtypes.NewCommissionRates(sdk.OneDec(), sdk.OneDec(), sdk.OneDec()),
sdk.OneInt(), sdk.OneInt(),
@ -347,7 +347,7 @@ func initTestnetFiles(
return err return err
} }
customAppTemplate, customAppConfig := config.AppConfig(ethermint.AttoPhoton) customAppTemplate, customAppConfig := config.AppConfig(laconicd.AttoPhoton)
srvconfig.SetConfigTemplate(customAppTemplate) srvconfig.SetConfigTemplate(customAppTemplate)
if err := sdkserver.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, tmconfig.DefaultConfig()); err != nil { if err := sdkserver.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, tmconfig.DefaultConfig()); err != nil {
return err return err
@ -356,7 +356,7 @@ func initTestnetFiles(
srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), appConfig) srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), appConfig)
} }
if err := initGenFiles(clientCtx, mbm, args.chainID, ethermint.AttoPhoton, genAccounts, genBalances, genFiles, args.numValidators); err != nil { if err := initGenFiles(clientCtx, mbm, args.chainID, laconicd.AttoPhoton, genAccounts, genBalances, genFiles, args.numValidators); err != nil {
return err return err
} }

View File

@ -3,7 +3,7 @@ package config
import ( import (
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
const ( const (
@ -38,9 +38,9 @@ func SetBech32Prefixes(config *sdk.Config) {
// SetBip44CoinType sets the global coin type to be used in hierarchical deterministic wallets. // SetBip44CoinType sets the global coin type to be used in hierarchical deterministic wallets.
func SetBip44CoinType(config *sdk.Config) { func SetBip44CoinType(config *sdk.Config) {
config.SetCoinType(ethermint.Bip44CoinType) config.SetCoinType(laconicd.Bip44CoinType)
config.SetPurpose(sdk.Purpose) // Shared config.SetPurpose(sdk.Purpose) // Shared
config.SetFullFundraiserPath(ethermint.BIP44HDPath) //nolint: staticcheck config.SetFullFundraiserPath(laconicd.BIP44HDPath) //nolint: staticcheck
} }
// RegisterDenoms registers the base and display denominations to the SDK. // RegisterDenoms registers the base and display denominations to the SDK.
@ -49,7 +49,7 @@ func RegisterDenoms() {
panic(err) panic(err)
} }
if err := sdk.RegisterDenom(ethermint.AttoPhoton, sdk.NewDecWithPrec(1, ethermint.BaseDenomUnit)); err != nil { if err := sdk.RegisterDenom(laconicd.AttoPhoton, sdk.NewDecWithPrec(1, laconicd.BaseDenomUnit)); err != nil {
panic(err) panic(err)
} }
} }

View File

@ -3,7 +3,7 @@ package config
import ( import (
"testing" "testing"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/hd"
@ -42,14 +42,14 @@ func TestSetCoinType(t *testing.T) {
require.Equal(t, sdk.FullFundraiserPath, config.GetFullBIP44Path()) require.Equal(t, sdk.FullFundraiserPath, config.GetFullBIP44Path())
SetBip44CoinType(config) SetBip44CoinType(config)
require.Equal(t, int(ethermint.Bip44CoinType), int(config.GetCoinType())) require.Equal(t, int(laconicd.Bip44CoinType), int(config.GetCoinType()))
require.Equal(t, sdk.GetConfig().GetCoinType(), config.GetCoinType()) require.Equal(t, sdk.GetConfig().GetCoinType(), config.GetCoinType())
require.Equal(t, sdk.GetConfig().GetFullBIP44Path(), config.GetFullBIP44Path()) require.Equal(t, sdk.GetConfig().GetFullBIP44Path(), config.GetFullBIP44Path())
} }
func TestHDPath(t *testing.T) { func TestHDPath(t *testing.T) {
params := *hd.NewFundraiserParams(0, ethermint.Bip44CoinType, 0) params := *hd.NewFundraiserParams(0, laconicd.Bip44CoinType, 0)
hdPath := params.String() hdPath := params.String()
require.Equal(t, "m/44'/60'/0'/0/0", hdPath) require.Equal(t, "m/44'/60'/0'/0/0", hdPath)
require.Equal(t, hdPath, ethermint.BIP44HDPath) require.Equal(t, hdPath, laconicd.BIP44HDPath)
} }

View File

@ -18,9 +18,9 @@ func TestInitCmd(t *testing.T) {
rootCmd, _ := laconicd.NewRootCmd() rootCmd, _ := laconicd.NewRootCmd()
rootCmd.SetArgs([]string{ rootCmd.SetArgs([]string{
"init", // Test the init cmd "init", // Test the init cmd
"etherminttest", // Moniker "laconicdtest", // Moniker
fmt.Sprintf("--%s=%s", cli.FlagOverwrite, "true"), // Overwrite genesis.json, in case it already exists fmt.Sprintf("--%s=%s", cli.FlagOverwrite, "true"), // Overwrite genesis.json, in case it already exists
fmt.Sprintf("--%s=%s", flags.FlagChainID, "ethermint_9000-1"), fmt.Sprintf("--%s=%s", flags.FlagChainID, "laconic_9000-1"),
}) })
err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome) err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome)

View File

@ -19,7 +19,7 @@ import (
genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
"github.com/cerc-io/laconicd/crypto/hd" "github.com/cerc-io/laconicd/crypto/hd"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
) )
@ -114,7 +114,7 @@ contain valid denominations. Accounts may optionally be supplied with vesting pa
return errors.New("invalid vesting parameters; must supply start and end time or end time") return errors.New("invalid vesting parameters; must supply start and end time or end time")
} }
} else { } else {
genAccount = &ethermint.EthAccount{ genAccount = &laconicd.EthAccount{
BaseAccount: baseAccount, BaseAccount: baseAccount,
CodeHash: common.BytesToHash(evmtypes.EmptyCodeHash).Hex(), CodeHash: common.BytesToHash(evmtypes.EmptyCodeHash).Hex(),
} }

View File

@ -33,14 +33,14 @@ import (
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
"github.com/cerc-io/laconicd/app" "github.com/cerc-io/laconicd/app"
ethermintclient "github.com/cerc-io/laconicd/client" laconicdclient "github.com/cerc-io/laconicd/client"
"github.com/cerc-io/laconicd/client/debug" "github.com/cerc-io/laconicd/client/debug"
"github.com/cerc-io/laconicd/crypto/hd" "github.com/cerc-io/laconicd/crypto/hd"
"github.com/cerc-io/laconicd/encoding" "github.com/cerc-io/laconicd/encoding"
"github.com/cerc-io/laconicd/server" "github.com/cerc-io/laconicd/server"
servercfg "github.com/cerc-io/laconicd/server/config" servercfg "github.com/cerc-io/laconicd/server/config"
srvflags "github.com/cerc-io/laconicd/server/flags" srvflags "github.com/cerc-io/laconicd/server/flags"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
const EnvPrefix = "ETHERMINT" const EnvPrefix = "ETHERMINT"
@ -63,7 +63,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
rootCmd := &cobra.Command{ rootCmd := &cobra.Command{
Use: "laconicd", Use: "laconicd",
Short: "Ethermint Daemon", Short: "Laconic Daemon",
PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { PersistentPreRunE: func(cmd *cobra.Command, _ []string) error {
// set the default command outputs // set the default command outputs
cmd.SetOut(cmd.OutOrStdout()) cmd.SetOut(cmd.OutOrStdout())
@ -84,7 +84,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
} }
// FIXME: replace AttoPhoton with bond denom // FIXME: replace AttoPhoton with bond denom
customAppTemplate, customAppConfig := servercfg.AppConfig(ethermint.AttoPhoton) customAppTemplate, customAppConfig := servercfg.AppConfig(laconicd.AttoPhoton)
return sdkserver.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, tmcfg.DefaultConfig()) return sdkserver.InterceptConfigsPreRunHandler(cmd, customAppTemplate, customAppConfig, tmcfg.DefaultConfig())
}, },
@ -97,7 +97,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
cfg.Seal() cfg.Seal()
rootCmd.AddCommand( rootCmd.AddCommand(
ethermintclient.ValidateChainID( laconicdclient.ValidateChainID(
genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), genutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome),
), ),
genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), genutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome),
@ -106,7 +106,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
genutilcli.ValidateGenesisCmd(app.ModuleBasics), genutilcli.ValidateGenesisCmd(app.ModuleBasics),
AddGenesisAccountCmd(app.DefaultNodeHome), AddGenesisAccountCmd(app.DefaultNodeHome),
tmcli.NewCompletionCmd(rootCmd, true), tmcli.NewCompletionCmd(rootCmd, true),
ethermintclient.NewTestnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}), laconicdclient.NewTestnetCmd(app.ModuleBasics, banktypes.GenesisBalancesIterator{}),
debug.Cmd(), debug.Cmd(),
config.Cmd(), config.Cmd(),
) )
@ -119,7 +119,7 @@ func NewRootCmd() (*cobra.Command, params.EncodingConfig) {
rpc.StatusCommand(), rpc.StatusCommand(),
queryCommand(), queryCommand(),
txCommand(), txCommand(),
ethermintclient.KeyCommands(app.DefaultNodeHome), laconicdclient.KeyCommands(app.DefaultNodeHome),
) )
rootCmd, err := srvflags.AddTxFlags(rootCmd) rootCmd, err := srvflags.AddTxFlags(rootCmd)
@ -231,7 +231,7 @@ func (a appCreator) newApp(logger tmlog.Logger, db dbm.DB, traceStore io.Writer,
cast.ToUint32(appOpts.Get(sdkserver.FlagStateSyncSnapshotKeepRecent)), cast.ToUint32(appOpts.Get(sdkserver.FlagStateSyncSnapshotKeepRecent)),
) )
ethermintApp := app.NewEthermintApp( laconicApp := app.NewLaconicApp(
logger, db, traceStore, true, skipUpgradeHeights, logger, db, traceStore, true, skipUpgradeHeights,
cast.ToString(appOpts.Get(flags.FlagHome)), cast.ToString(appOpts.Get(flags.FlagHome)),
cast.ToUint(appOpts.Get(sdkserver.FlagInvCheckPeriod)), cast.ToUint(appOpts.Get(sdkserver.FlagInvCheckPeriod)),
@ -248,7 +248,7 @@ func (a appCreator) newApp(logger tmlog.Logger, db dbm.DB, traceStore io.Writer,
baseapp.SetSnapshot(snapshotStore, snapshotOptions), baseapp.SetSnapshot(snapshotStore, snapshotOptions),
) )
return ethermintApp return laconicApp
} }
// appExport creates a new simapp (optionally at a given height) // appExport creates a new simapp (optionally at a given height)
@ -257,21 +257,21 @@ func (a appCreator) appExport(
logger tmlog.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string, logger tmlog.Logger, db dbm.DB, traceStore io.Writer, height int64, forZeroHeight bool, jailAllowedAddrs []string,
appOpts servertypes.AppOptions, appOpts servertypes.AppOptions,
) (servertypes.ExportedApp, error) { ) (servertypes.ExportedApp, error) {
var ethermintApp *app.EthermintApp var laconicApp *app.LaconicApp
homePath, ok := appOpts.Get(flags.FlagHome).(string) homePath, ok := appOpts.Get(flags.FlagHome).(string)
if !ok || homePath == "" { if !ok || homePath == "" {
return servertypes.ExportedApp{}, errors.New("application home not set") return servertypes.ExportedApp{}, errors.New("application home not set")
} }
if height != -1 { if height != -1 {
ethermintApp = app.NewEthermintApp(logger, db, traceStore, false, map[int64]bool{}, "", uint(1), a.encCfg, appOpts) laconicApp = app.NewLaconicApp(logger, db, traceStore, false, map[int64]bool{}, "", uint(1), a.encCfg, appOpts)
if err := ethermintApp.LoadHeight(height); err != nil { if err := laconicApp.LoadHeight(height); err != nil {
return servertypes.ExportedApp{}, err return servertypes.ExportedApp{}, err
} }
} else { } else {
ethermintApp = app.NewEthermintApp(logger, db, traceStore, true, map[int64]bool{}, "", uint(1), a.encCfg, appOpts) laconicApp = app.NewLaconicApp(logger, db, traceStore, true, map[int64]bool{}, "", uint(1), a.encCfg, appOpts)
} }
return ethermintApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs) return laconicApp.ExportAppStateAndValidators(forZeroHeight, jailAllowedAddrs)
} }

View File

@ -17,7 +17,7 @@ import (
cryptocodec "github.com/cerc-io/laconicd/crypto/codec" cryptocodec "github.com/cerc-io/laconicd/crypto/codec"
enccodec "github.com/cerc-io/laconicd/encoding/codec" enccodec "github.com/cerc-io/laconicd/encoding/codec"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
var TestCodec codec.Codec var TestCodec codec.Codec
@ -46,7 +46,7 @@ func TestKeyring(t *testing.T) {
require.Nil(t, info) require.Nil(t, info)
mockIn.Reset("password\npassword\n") mockIn.Reset("password\npassword\n")
info, mnemonic, err := kr.NewMnemonic("foo", keyring.English, ethermint.BIP44HDPath, keyring.DefaultBIP39Passphrase, EthSecp256k1) info, mnemonic, err := kr.NewMnemonic("foo", keyring.English, laconicd.BIP44HDPath, keyring.DefaultBIP39Passphrase, EthSecp256k1)
require.NoError(t, err) require.NoError(t, err)
require.NotEmpty(t, mnemonic) require.NotEmpty(t, mnemonic)
require.Equal(t, "foo", info.Name) require.Equal(t, "foo", info.Name)
@ -55,7 +55,7 @@ func TestKeyring(t *testing.T) {
require.NoError(t, err) require.NoError(t, err)
require.Equal(t, string(EthSecp256k1Type), pubKey.Type()) require.Equal(t, string(EthSecp256k1Type), pubKey.Type())
hdPath := ethermint.BIP44HDPath hdPath := laconicd.BIP44HDPath
bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, hdPath) bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, hdPath)
require.NoError(t, err) require.NoError(t, err)
@ -79,7 +79,7 @@ func TestKeyring(t *testing.T) {
} }
func TestDerivation(t *testing.T) { func TestDerivation(t *testing.T) {
bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, ethermint.BIP44HDPath) bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, laconicd.BIP44HDPath)
require.NoError(t, err) require.NoError(t, err)
require.NotEmpty(t, bz) require.NotEmpty(t, bz)
@ -97,7 +97,7 @@ func TestDerivation(t *testing.T) {
wallet, err := hdwallet.NewFromMnemonic(mnemonic) wallet, err := hdwallet.NewFromMnemonic(mnemonic)
require.NoError(t, err) require.NoError(t, err)
path := hdwallet.MustParseDerivationPath(ethermint.BIP44HDPath) path := hdwallet.MustParseDerivationPath(laconicd.BIP44HDPath)
account, err := wallet.Derive(path, false) account, err := wallet.Derive(path, false)
require.NoError(t, err) require.NoError(t, err)

View File

@ -3,7 +3,7 @@ package hd
import ( import (
"testing" "testing"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/cosmos/cosmos-sdk/crypto/keyring"
) )
@ -11,14 +11,14 @@ func BenchmarkEthSecp256k1Algo_Derive(b *testing.B) {
b.ReportAllocs() b.ReportAllocs()
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
deriveFn := EthSecp256k1.Derive() deriveFn := EthSecp256k1.Derive()
if _, err := deriveFn(mnemonic, keyring.DefaultBIP39Passphrase, ethermint.BIP44HDPath); err != nil { if _, err := deriveFn(mnemonic, keyring.DefaultBIP39Passphrase, laconicd.BIP44HDPath); err != nil {
b.Fatal(err) b.Fatal(err)
} }
} }
} }
func BenchmarkEthSecp256k1Algo_Generate(b *testing.B) { func BenchmarkEthSecp256k1Algo_Generate(b *testing.B) {
bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, ethermint.BIP44HDPath) bz, err := EthSecp256k1.Derive()(mnemonic, keyring.DefaultBIP39Passphrase, laconicd.BIP44HDPath)
if err != nil { if err != nil {
b.Fatal(err) b.Fatal(err)
} }

View File

@ -7,7 +7,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
cryptocodec "github.com/cerc-io/laconicd/crypto/codec" cryptocodec "github.com/cerc-io/laconicd/crypto/codec"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
// RegisterLegacyAminoCodec registers Interfaces from types, crypto, and SDK std. // RegisterLegacyAminoCodec registers Interfaces from types, crypto, and SDK std.
@ -21,5 +21,5 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) {
func RegisterInterfaces(interfaceRegistry codectypes.InterfaceRegistry) { func RegisterInterfaces(interfaceRegistry codectypes.InterfaceRegistry) {
std.RegisterInterfaces(interfaceRegistry) std.RegisterInterfaces(interfaceRegistry)
cryptocodec.RegisterInterfaces(interfaceRegistry) cryptocodec.RegisterInterfaces(interfaceRegistry)
ethermint.RegisterInterfaces(interfaceRegistry) laconicd.RegisterInterfaces(interfaceRegistry)
} }

View File

@ -24,7 +24,7 @@ import (
// Testing Constants // Testing Constants
var ( var (
chainId = "ethermint_9000-1" chainId = "laconic_9000-1"
ctx = client.Context{}.WithTxConfig( ctx = client.Context{}.WithTxConfig(
encoding.MakeConfig(app.ModuleBasics).TxConfig, encoding.MakeConfig(app.ModuleBasics).TxConfig,
) )

View File

@ -15,7 +15,7 @@ import (
tmtypes "github.com/tendermint/tendermint/types" tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db" dbm "github.com/tendermint/tm-db"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
) )
@ -27,7 +27,7 @@ const (
TxIndexKeyLength = 1 + 8 + 8 TxIndexKeyLength = 1 + 8 + 8
) )
var _ ethermint.EVMTxIndexer = &KVIndexer{} var _ laconicd.EVMTxIndexer = &KVIndexer{}
// KVIndexer implements a eth tx indexer on a KV db. // KVIndexer implements a eth tx indexer on a KV db.
type KVIndexer struct { type KVIndexer struct {
@ -81,7 +81,7 @@ func (kv *KVIndexer) IndexBlock(block *tmtypes.Block, txResults []*abci.Response
ethMsg := msg.(*evmtypes.MsgEthereumTx) ethMsg := msg.(*evmtypes.MsgEthereumTx)
txHash := common.HexToHash(ethMsg.Hash) txHash := common.HexToHash(ethMsg.Hash)
txResult := ethermint.TxResult{ txResult := laconicd.TxResult{
Height: height, Height: height,
TxIndex: uint32(txIndex), TxIndex: uint32(txIndex),
MsgIndex: uint32(msgIndex), MsgIndex: uint32(msgIndex),
@ -131,7 +131,7 @@ func (kv *KVIndexer) FirstIndexedBlock() (int64, error) {
} }
// GetByTxHash finds eth tx by eth tx hash // GetByTxHash finds eth tx by eth tx hash
func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*ethermint.TxResult, error) { func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*laconicd.TxResult, error) {
bz, err := kv.db.Get(TxHashKey(hash)) bz, err := kv.db.Get(TxHashKey(hash))
if err != nil { if err != nil {
return nil, sdkerrors.Wrapf(err, "GetByTxHash %s", hash.Hex()) return nil, sdkerrors.Wrapf(err, "GetByTxHash %s", hash.Hex())
@ -139,7 +139,7 @@ func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*ethermint.TxResult, error)
if len(bz) == 0 { if len(bz) == 0 {
return nil, fmt.Errorf("tx not found, hash: %s", hash.Hex()) return nil, fmt.Errorf("tx not found, hash: %s", hash.Hex())
} }
var txKey ethermint.TxResult var txKey laconicd.TxResult
if err := kv.clientCtx.Codec.Unmarshal(bz, &txKey); err != nil { if err := kv.clientCtx.Codec.Unmarshal(bz, &txKey); err != nil {
return nil, sdkerrors.Wrapf(err, "GetByTxHash %s", hash.Hex()) return nil, sdkerrors.Wrapf(err, "GetByTxHash %s", hash.Hex())
} }
@ -147,7 +147,7 @@ func (kv *KVIndexer) GetByTxHash(hash common.Hash) (*ethermint.TxResult, error)
} }
// GetByBlockAndIndex finds eth tx by block number and eth tx index // GetByBlockAndIndex finds eth tx by block number and eth tx index
func (kv *KVIndexer) GetByBlockAndIndex(blockNumber int64, txIndex int32) (*ethermint.TxResult, error) { func (kv *KVIndexer) GetByBlockAndIndex(blockNumber int64, txIndex int32) (*laconicd.TxResult, error) {
bz, err := kv.db.Get(TxIndexKey(blockNumber, txIndex)) bz, err := kv.db.Get(TxIndexKey(blockNumber, txIndex))
if err != nil { if err != nil {
return nil, sdkerrors.Wrapf(err, "GetByBlockAndIndex %d %d", blockNumber, txIndex) return nil, sdkerrors.Wrapf(err, "GetByBlockAndIndex %d %d", blockNumber, txIndex)
@ -210,7 +210,7 @@ func isEthTx(tx sdk.Tx) bool {
} }
// saveTxResult index the txResult into the kv db batch // saveTxResult index the txResult into the kv db batch
func saveTxResult(codec codec.Codec, batch dbm.Batch, txHash common.Hash, txResult *ethermint.TxResult) error { func saveTxResult(codec codec.Codec, batch dbm.Batch, txHash common.Hash, txResult *laconicd.TxResult) error {
bz := codec.MustMarshal(txResult) bz := codec.MustMarshal(txResult)
if err := batch.Set(TxHashKey(txHash), bz); err != nil { if err := batch.Set(TxHashKey(txHash), bz); err != nil {
return sdkerrors.Wrap(err, "set tx-hash key") return sdkerrors.Wrap(err, "set tx-hash key")

View File

@ -9,7 +9,7 @@ rem 3. add path C:\msys64\mingw64\bin
rem C:\msys64\usr\bin rem C:\msys64\usr\bin
set KEY="mykey" set KEY="mykey"
set CHAINID="ethermint_9000-1" set CHAINID="laconic_9000-1"
set MONIKER="localtestnet" set MONIKER="localtestnet"
set KEYRING="test" set KEYRING="test"
set KEYALGO="eth_secp256k1" set KEYALGO="eth_secp256k1"

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
KEY="mykey" KEY="mykey"
CHAINID="ethermint_9000-1" CHAINID="laconic_9000-1"
MONIKER="localtestnet" MONIKER="localtestnet"
KEYRING="test" KEYRING="test"
KEYALGO="eth_secp256k1" KEYALGO="eth_secp256k1"

View File

@ -19,7 +19,7 @@ import (
"github.com/cerc-io/laconicd/rpc/namespaces/ethereum/personal" "github.com/cerc-io/laconicd/rpc/namespaces/ethereum/personal"
"github.com/cerc-io/laconicd/rpc/namespaces/ethereum/txpool" "github.com/cerc-io/laconicd/rpc/namespaces/ethereum/txpool"
"github.com/cerc-io/laconicd/rpc/namespaces/ethereum/web3" "github.com/cerc-io/laconicd/rpc/namespaces/ethereum/web3"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
rpcclient "github.com/tendermint/tendermint/rpc/jsonrpc/client" rpcclient "github.com/tendermint/tendermint/rpc/jsonrpc/client"
) )
@ -49,7 +49,7 @@ type APICreator = func(
clientCtx client.Context, clientCtx client.Context,
tendermintWebsocketClient *rpcclient.WSClient, tendermintWebsocketClient *rpcclient.WSClient,
allowUnprotectedTxs bool, allowUnprotectedTxs bool,
indexer ethermint.EVMTxIndexer, indexer laconicd.EVMTxIndexer,
) []rpc.API ) []rpc.API
// apiCreators defines the JSON-RPC API namespaces. // apiCreators defines the JSON-RPC API namespaces.
@ -61,7 +61,7 @@ func init() {
clientCtx client.Context, clientCtx client.Context,
tmWSClient *rpcclient.WSClient, tmWSClient *rpcclient.WSClient,
allowUnprotectedTxs bool, allowUnprotectedTxs bool,
indexer ethermint.EVMTxIndexer, indexer laconicd.EVMTxIndexer,
) []rpc.API { ) []rpc.API {
evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer) evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer)
return []rpc.API{ return []rpc.API{
@ -79,7 +79,7 @@ func init() {
}, },
} }
}, },
Web3Namespace: func(*server.Context, client.Context, *rpcclient.WSClient, bool, ethermint.EVMTxIndexer) []rpc.API { Web3Namespace: func(*server.Context, client.Context, *rpcclient.WSClient, bool, laconicd.EVMTxIndexer) []rpc.API {
return []rpc.API{ return []rpc.API{
{ {
Namespace: Web3Namespace, Namespace: Web3Namespace,
@ -89,7 +89,7 @@ func init() {
}, },
} }
}, },
NetNamespace: func(_ *server.Context, clientCtx client.Context, _ *rpcclient.WSClient, _ bool, _ ethermint.EVMTxIndexer) []rpc.API { NetNamespace: func(_ *server.Context, clientCtx client.Context, _ *rpcclient.WSClient, _ bool, _ laconicd.EVMTxIndexer) []rpc.API {
return []rpc.API{ return []rpc.API{
{ {
Namespace: NetNamespace, Namespace: NetNamespace,
@ -103,7 +103,7 @@ func init() {
clientCtx client.Context, clientCtx client.Context,
_ *rpcclient.WSClient, _ *rpcclient.WSClient,
allowUnprotectedTxs bool, allowUnprotectedTxs bool,
indexer ethermint.EVMTxIndexer, indexer laconicd.EVMTxIndexer,
) []rpc.API { ) []rpc.API {
evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer) evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer)
return []rpc.API{ return []rpc.API{
@ -115,7 +115,7 @@ func init() {
}, },
} }
}, },
TxPoolNamespace: func(ctx *server.Context, _ client.Context, _ *rpcclient.WSClient, _ bool, _ ethermint.EVMTxIndexer) []rpc.API { TxPoolNamespace: func(ctx *server.Context, _ client.Context, _ *rpcclient.WSClient, _ bool, _ laconicd.EVMTxIndexer) []rpc.API {
return []rpc.API{ return []rpc.API{
{ {
Namespace: TxPoolNamespace, Namespace: TxPoolNamespace,
@ -129,7 +129,7 @@ func init() {
clientCtx client.Context, clientCtx client.Context,
_ *rpcclient.WSClient, _ *rpcclient.WSClient,
allowUnprotectedTxs bool, allowUnprotectedTxs bool,
indexer ethermint.EVMTxIndexer, indexer laconicd.EVMTxIndexer,
) []rpc.API { ) []rpc.API {
evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer) evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer)
return []rpc.API{ return []rpc.API{
@ -145,7 +145,7 @@ func init() {
clientCtx client.Context, clientCtx client.Context,
_ *rpcclient.WSClient, _ *rpcclient.WSClient,
allowUnprotectedTxs bool, allowUnprotectedTxs bool,
indexer ethermint.EVMTxIndexer, indexer laconicd.EVMTxIndexer,
) []rpc.API { ) []rpc.API {
evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer) evmBackend := backend.NewBackend(ctx, ctx.Logger, clientCtx, allowUnprotectedTxs, indexer)
return []rpc.API{ return []rpc.API{
@ -165,7 +165,7 @@ func GetRPCAPIs(ctx *server.Context,
clientCtx client.Context, clientCtx client.Context,
tmWSClient *rpcclient.WSClient, tmWSClient *rpcclient.WSClient,
allowUnprotectedTxs bool, allowUnprotectedTxs bool,
indexer ethermint.EVMTxIndexer, indexer laconicd.EVMTxIndexer,
selectedAPIs []string, selectedAPIs []string,
) []rpc.API { ) []rpc.API {
var apis []rpc.API var apis []rpc.API

View File

@ -8,7 +8,7 @@ import (
"github.com/cerc-io/laconicd/crypto/hd" "github.com/cerc-io/laconicd/crypto/hd"
rpctypes "github.com/cerc-io/laconicd/rpc/types" rpctypes "github.com/cerc-io/laconicd/rpc/types"
"github.com/cerc-io/laconicd/server/config" "github.com/cerc-io/laconicd/server/config"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/flags"
@ -103,8 +103,8 @@ type EVMBackend interface {
// Tx Info // Tx Info
GetTransactionByHash(txHash common.Hash) (*rpctypes.RPCTransaction, error) GetTransactionByHash(txHash common.Hash) (*rpctypes.RPCTransaction, error)
GetTxByEthHash(txHash common.Hash) (*ethermint.TxResult, error) GetTxByEthHash(txHash common.Hash) (*laconicd.TxResult, error)
GetTxByTxIndex(height int64, txIndex uint) (*ethermint.TxResult, error) GetTxByTxIndex(height int64, txIndex uint) (*laconicd.TxResult, error)
GetTransactionByBlockAndIndex(block *tmrpctypes.ResultBlock, idx hexutil.Uint) (*rpctypes.RPCTransaction, error) GetTransactionByBlockAndIndex(block *tmrpctypes.ResultBlock, idx hexutil.Uint) (*rpctypes.RPCTransaction, error)
GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error) GetTransactionReceipt(hash common.Hash) (map[string]interface{}, error)
GetTransactionByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) (*rpctypes.RPCTransaction, error) GetTransactionByBlockHashAndIndex(hash common.Hash, idx hexutil.Uint) (*rpctypes.RPCTransaction, error)
@ -141,7 +141,7 @@ type Backend struct {
chainID *big.Int chainID *big.Int
cfg config.Config cfg config.Config
allowUnprotectedTxs bool allowUnprotectedTxs bool
indexer ethermint.EVMTxIndexer indexer laconicd.EVMTxIndexer
} }
// NewBackend creates a new Backend instance for cosmos and ethereum namespaces // NewBackend creates a new Backend instance for cosmos and ethereum namespaces
@ -150,9 +150,9 @@ func NewBackend(
logger log.Logger, logger log.Logger,
clientCtx client.Context, clientCtx client.Context,
allowUnprotectedTxs bool, allowUnprotectedTxs bool,
indexer ethermint.EVMTxIndexer, indexer laconicd.EVMTxIndexer,
) *Backend { ) *Backend {
chainID, err := ethermint.ParseChainID(clientCtx.ChainID) chainID, err := laconicd.ParseChainID(clientCtx.ChainID)
if err != nil { if err != nil {
panic(err) panic(err)
} }

View File

@ -51,7 +51,7 @@ func (suite *BackendTestSuite) SetupTest() {
} }
encodingConfig := encoding.MakeConfig(app.ModuleBasics) encodingConfig := encoding.MakeConfig(app.ModuleBasics)
clientCtx := client.Context{}.WithChainID("ethermint_9000-1"). clientCtx := client.Context{}.WithChainID("laconic_9000-1").
WithHeight(1). WithHeight(1).
WithTxConfig(encodingConfig.TxConfig). WithTxConfig(encodingConfig.TxConfig).
WithKeyringDir(clientDir). WithKeyringDir(clientDir).

View File

@ -8,7 +8,7 @@ import (
"math/big" "math/big"
rpctypes "github.com/cerc-io/laconicd/rpc/types" rpctypes "github.com/cerc-io/laconicd/rpc/types"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
"github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/flags"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
@ -35,7 +35,7 @@ func (b *Backend) Resend(args evmtypes.TransactionArgs, gasPrice *hexutil.Big, g
// The signer used should always be the 'latest' known one because we expect // The signer used should always be the 'latest' known one because we expect
// signers to be backwards-compatible with old transactions. // signers to be backwards-compatible with old transactions.
eip155ChainID, err := ethermint.ParseChainID(b.clientCtx.ChainID) eip155ChainID, err := laconicd.ParseChainID(b.clientCtx.ChainID)
if err != nil { if err != nil {
return common.Hash{}, err return common.Hash{}, err
} }

View File

@ -6,7 +6,7 @@ import (
"strconv" "strconv"
rpctypes "github.com/cerc-io/laconicd/rpc/types" rpctypes "github.com/cerc-io/laconicd/rpc/types"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
feemarkettypes "github.com/cerc-io/laconicd/x/feemarket/types" feemarkettypes "github.com/cerc-io/laconicd/x/feemarket/types"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
@ -19,7 +19,7 @@ import (
// ChainID is the EIP-155 replay-protection chain id for the current ethereum chain config. // ChainID is the EIP-155 replay-protection chain id for the current ethereum chain config.
func (b *Backend) ChainID() (*hexutil.Big, error) { func (b *Backend) ChainID() (*hexutil.Big, error) {
eip155ChainID, err := ethermint.ParseChainID(b.clientCtx.ChainID) eip155ChainID, err := laconicd.ParseChainID(b.clientCtx.ChainID)
if err != nil { if err != nil {
panic(err) panic(err)
} }

View File

@ -9,7 +9,7 @@ import (
"github.com/cerc-io/laconicd/crypto/ethsecp256k1" "github.com/cerc-io/laconicd/crypto/ethsecp256k1"
rpctypes "github.com/cerc-io/laconicd/rpc/types" rpctypes "github.com/cerc-io/laconicd/rpc/types"
"github.com/cerc-io/laconicd/server/config" "github.com/cerc-io/laconicd/server/config"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
"github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/client/tx"
@ -326,13 +326,13 @@ func (b *Backend) RPCBlockRangeCap() int32 {
func (b *Backend) RPCMinGasPrice() int64 { func (b *Backend) RPCMinGasPrice() int64 {
evmParams, err := b.queryClient.Params(b.ctx, &evmtypes.QueryParamsRequest{}) evmParams, err := b.queryClient.Params(b.ctx, &evmtypes.QueryParamsRequest{})
if err != nil { if err != nil {
return ethermint.DefaultGasPrice return laconicd.DefaultGasPrice
} }
minGasPrice := b.cfg.GetMinGasPrices() minGasPrice := b.cfg.GetMinGasPrices()
amt := minGasPrice.AmountOf(evmParams.Params.EvmDenom).TruncateInt64() amt := minGasPrice.AmountOf(evmParams.Params.EvmDenom).TruncateInt64()
if amt == 0 { if amt == 0 {
return ethermint.DefaultGasPrice return laconicd.DefaultGasPrice
} }
return amt return amt

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
rpctypes "github.com/cerc-io/laconicd/rpc/types" rpctypes "github.com/cerc-io/laconicd/rpc/types"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
@ -277,7 +277,7 @@ func (b *Backend) GetTransactionByBlockNumberAndIndex(blockNum rpctypes.BlockNum
// GetTxByEthHash uses `/tx_query` to find transaction by ethereum tx hash // GetTxByEthHash uses `/tx_query` to find transaction by ethereum tx hash
// TODO: Don't need to convert once hashing is fixed on Tendermint // TODO: Don't need to convert once hashing is fixed on Tendermint
// https://github.com/tendermint/tendermint/issues/6539 // https://github.com/tendermint/tendermint/issues/6539
func (b *Backend) GetTxByEthHash(hash common.Hash) (*ethermint.TxResult, error) { func (b *Backend) GetTxByEthHash(hash common.Hash) (*laconicd.TxResult, error) {
if b.indexer != nil { if b.indexer != nil {
return b.indexer.GetByTxHash(hash) return b.indexer.GetByTxHash(hash)
} }
@ -294,7 +294,7 @@ func (b *Backend) GetTxByEthHash(hash common.Hash) (*ethermint.TxResult, error)
} }
// GetTxByTxIndex uses `/tx_query` to find transaction by tx index of valid ethereum txs // GetTxByTxIndex uses `/tx_query` to find transaction by tx index of valid ethereum txs
func (b *Backend) GetTxByTxIndex(height int64, index uint) (*ethermint.TxResult, error) { func (b *Backend) GetTxByTxIndex(height int64, index uint) (*laconicd.TxResult, error) {
if b.indexer != nil { if b.indexer != nil {
return b.indexer.GetByBlockAndIndex(height, int32(index)) return b.indexer.GetByBlockAndIndex(height, int32(index))
} }
@ -314,7 +314,7 @@ func (b *Backend) GetTxByTxIndex(height int64, index uint) (*ethermint.TxResult,
} }
// queryTendermintTxIndexer query tx in tendermint tx indexer // queryTendermintTxIndexer query tx in tendermint tx indexer
func (b *Backend) queryTendermintTxIndexer(query string, txGetter func(*rpctypes.ParsedTxs) *rpctypes.ParsedTx) (*ethermint.TxResult, error) { func (b *Backend) queryTendermintTxIndexer(query string, txGetter func(*rpctypes.ParsedTxs) *rpctypes.ParsedTx) (*laconicd.TxResult, error) {
resTxs, err := b.clientCtx.Client.TxSearch(b.ctx, query, false, nil, nil, "") resTxs, err := b.clientCtx.Client.TxSearch(b.ctx, query, false, nil, nil, "")
if err != nil { if err != nil {
return nil, err return nil, err

View File

@ -16,7 +16,7 @@ import (
"github.com/cerc-io/laconicd/rpc/backend" "github.com/cerc-io/laconicd/rpc/backend"
rpctypes "github.com/cerc-io/laconicd/rpc/types" rpctypes "github.com/cerc-io/laconicd/rpc/types"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
) )
@ -293,7 +293,7 @@ func (e *PublicAPI) Call(args evmtypes.TransactionArgs,
// ProtocolVersion returns the supported Ethereum protocol version. // ProtocolVersion returns the supported Ethereum protocol version.
func (e *PublicAPI) ProtocolVersion() hexutil.Uint { func (e *PublicAPI) ProtocolVersion() hexutil.Uint {
e.logger.Debug("eth_protocolVersion") e.logger.Debug("eth_protocolVersion")
return hexutil.Uint(ethermint.ProtocolVersion) return hexutil.Uint(laconicd.ProtocolVersion)
} }
// GasPrice returns the current gas price based on Ethermint's gas price oracle. // GasPrice returns the current gas price based on Ethermint's gas price oracle.

View File

@ -4,7 +4,7 @@ import (
"context" "context"
"fmt" "fmt"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client"
rpcclient "github.com/tendermint/tendermint/rpc/client" rpcclient "github.com/tendermint/tendermint/rpc/client"
) )
@ -18,7 +18,7 @@ type PublicAPI struct {
// NewPublicAPI creates an instance of the public Net Web3 API. // NewPublicAPI creates an instance of the public Net Web3 API.
func NewPublicAPI(clientCtx client.Context) *PublicAPI { func NewPublicAPI(clientCtx client.Context) *PublicAPI {
// parse the chainID from a integer string // parse the chainID from a integer string
chainIDEpoch, err := ethermint.ParseChainID(clientCtx.ChainID) chainIDEpoch, err := laconicd.ParseChainID(clientCtx.ChainID)
if err != nil { if err != nil {
panic(err) panic(err)
} }

View File

@ -9,7 +9,7 @@ import (
"github.com/cerc-io/laconicd/rpc/backend" "github.com/cerc-io/laconicd/rpc/backend"
"github.com/cerc-io/laconicd/crypto/hd" "github.com/cerc-io/laconicd/crypto/hd"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/libs/log"
@ -28,7 +28,7 @@ import (
type PrivateAccountAPI struct { type PrivateAccountAPI struct {
backend backend.EVMBackend backend backend.EVMBackend
logger log.Logger logger log.Logger
hdPathIter ethermint.HDPathIterator hdPathIter laconicd.HDPathIterator
} }
// NewAPI creates an instance of the public Personal Eth API. // NewAPI creates an instance of the public Personal Eth API.
@ -39,7 +39,7 @@ func NewAPI(
cfg := sdk.GetConfig() cfg := sdk.GetConfig()
basePath := cfg.GetFullBIP44Path() basePath := cfg.GetFullBIP44Path()
iterator, err := ethermint.NewHDPathIterator(basePath, true) iterator, err := laconicd.NewHDPathIterator(basePath, true)
if err != nil { if err != nil {
panic(err) panic(err)
} }

View File

@ -17,7 +17,7 @@ import (
grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" grpctypes "github.com/cosmos/cosmos-sdk/types/grpc"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
// BlockNumber represents decoding hex string to block values // BlockNumber represents decoding hex string to block values
@ -182,7 +182,7 @@ func (bnh *BlockNumberOrHash) decodeFromString(input string) error {
return err return err
} }
bnInt, err := ethermint.SafeInt64(blockNumber) bnInt, err := laconicd.SafeInt64(blockNumber)
if err != nil { if err != nil {
return err return err
} }

View File

@ -4,7 +4,7 @@ import (
"fmt" "fmt"
"strconv" "strconv"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
sdk "github.com/cosmos/cosmos-sdk/types" sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
@ -137,7 +137,7 @@ func ParseTxResult(result *abci.ResponseDeliverTx, tx sdk.Tx) (*ParsedTxs, error
} }
// ParseTxIndexerResult parse tm tx result to a format compatible with the custom tx indexer. // ParseTxIndexerResult parse tm tx result to a format compatible with the custom tx indexer.
func ParseTxIndexerResult(txResult *tmrpctypes.ResultTx, tx sdk.Tx, getter func(*ParsedTxs) *ParsedTx) (*ethermint.TxResult, error) { func ParseTxIndexerResult(txResult *tmrpctypes.ResultTx, tx sdk.Tx, getter func(*ParsedTxs) *ParsedTx) (*laconicd.TxResult, error) {
txs, err := ParseTxResult(&txResult.TxResult, tx) txs, err := ParseTxResult(&txResult.TxResult, tx)
if err != nil { if err != nil {
return nil, fmt.Errorf("failed to parse tx events: block %d, index %d, %v", txResult.Height, txResult.Index, err) return nil, fmt.Errorf("failed to parse tx events: block %d, index %d, %v", txResult.Height, txResult.Index, err)
@ -148,7 +148,7 @@ func ParseTxIndexerResult(txResult *tmrpctypes.ResultTx, tx sdk.Tx, getter func(
return nil, fmt.Errorf("ethereum tx not found in msgs: block %d, index %d", txResult.Height, txResult.Index) return nil, fmt.Errorf("ethereum tx not found in msgs: block %d, index %d", txResult.Height, txResult.Index)
} }
return &ethermint.TxResult{ return &laconicd.TxResult{
Height: txResult.Height, Height: txResult.Height,
TxIndex: txResult.Index, TxIndex: txResult.Index,
MsgIndex: uint32(parsedTx.MsgIndex), MsgIndex: uint32(parsedTx.MsgIndex),

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
KEY="mykey" KEY="mykey"
CHAINID="ethermint_9000-1" CHAINID="laconic_9000-1"
MONIKER="localtestnet" MONIKER="localtestnet"
# stop and remove existing daemon and client data and process(es) # stop and remove existing daemon and client data and process(es)

View File

@ -1,5 +1,5 @@
dotenv: .env dotenv: .env
ethermint_9000-1: laconic_9000-1:
cmd: laconicd cmd: laconicd
start-flags: "--trace" start-flags: "--trace"
app-config: app-config:

View File

@ -1,5 +1,5 @@
dotenv: .env dotenv: .env
ethermint_9000-1: laconic_9000-1:
cmd: laconicd cmd: laconicd
start-flags: "--trace" start-flags: "--trace"
app-config: app-config:

View File

@ -15,7 +15,7 @@ IP_ADDR="0.0.0.0"
MODE="rpc" MODE="rpc"
KEY="mykey" KEY="mykey"
CHAINID="ethermint_9000-1" CHAINID="laconic_9000-1"
MONIKER="mymoniker" MONIKER="mymoniker"
## default port prefixes for laconicd ## default port prefixes for laconicd
@ -47,14 +47,14 @@ done
set -euxo pipefail set -euxo pipefail
DATA_DIR=$(mktemp -d -t ethermint_9000-datadir.XXXXX) DATA_DIR=$(mktemp -d -t laconic_9000-datadir.XXXXX)
if [[ ! "$DATA_DIR" ]]; then if [[ ! "$DATA_DIR" ]]; then
echo "Could not create $DATA_DIR" echo "Could not create $DATA_DIR"
exit 1 exit 1
fi fi
DATA_CLI_DIR=$(mktemp -d -t ethermint_9000-cli-datadir.XXXXX) DATA_CLI_DIR=$(mktemp -d -t laconic_9000-cli-datadir.XXXXX)
if [[ ! "$DATA_CLI_DIR" ]]; then if [[ ! "$DATA_CLI_DIR" ]]; then
echo "Could not create $DATA_CLI_DIR" echo "Could not create $DATA_CLI_DIR"

View File

@ -8,7 +8,7 @@ import (
rpcclient "github.com/tendermint/tendermint/rpc/client" rpcclient "github.com/tendermint/tendermint/rpc/client"
"github.com/tendermint/tendermint/types" "github.com/tendermint/tendermint/types"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
const ( const (
@ -21,13 +21,13 @@ const (
type EVMIndexerService struct { type EVMIndexerService struct {
service.BaseService service.BaseService
txIdxr ethermint.EVMTxIndexer txIdxr laconicd.EVMTxIndexer
client rpcclient.Client client rpcclient.Client
} }
// NewEVMIndexerService returns a new service instance. // NewEVMIndexerService returns a new service instance.
func NewEVMIndexerService( func NewEVMIndexerService(
txIdxr ethermint.EVMTxIndexer, txIdxr laconicd.EVMTxIndexer,
client rpcclient.Client, client rpcclient.Client,
) *EVMIndexerService { ) *EVMIndexerService {
is := &EVMIndexerService{txIdxr: txIdxr, client: client} is := &EVMIndexerService{txIdxr: txIdxr, client: client}

View File

@ -15,7 +15,7 @@ import (
ethrpc "github.com/ethereum/go-ethereum/rpc" ethrpc "github.com/ethereum/go-ethereum/rpc"
"github.com/cerc-io/laconicd/server/config" "github.com/cerc-io/laconicd/server/config"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
// StartJSONRPC starts the JSON-RPC server // StartJSONRPC starts the JSON-RPC server
@ -24,7 +24,7 @@ func StartJSONRPC(ctx *server.Context,
tmRPCAddr, tmRPCAddr,
tmEndpoint string, tmEndpoint string,
config *config.Config, config *config.Config,
indexer ethermint.EVMTxIndexer, indexer laconicd.EVMTxIndexer,
) (*http.Server, chan struct{}, error) { ) (*http.Server, chan struct{}, error) {
tmWsClient := ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger) tmWsClient := ConnectTmWS(tmRPCAddr, tmEndpoint, ctx.Logger)

View File

@ -48,7 +48,7 @@ import (
ethdebug "github.com/cerc-io/laconicd/rpc/namespaces/ethereum/debug" ethdebug "github.com/cerc-io/laconicd/rpc/namespaces/ethereum/debug"
"github.com/cerc-io/laconicd/server/config" "github.com/cerc-io/laconicd/server/config"
srvflags "github.com/cerc-io/laconicd/server/flags" srvflags "github.com/cerc-io/laconicd/server/flags"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
// StartCmd runs the service passed in, either stand-alone or in-process with // StartCmd runs the service passed in, either stand-alone or in-process with
@ -341,7 +341,7 @@ func startInProcess(ctx *server.Context, clientCtx client.Context, appCreator ty
app.RegisterTendermintService(clientCtx) app.RegisterTendermintService(clientCtx)
} }
var idxer ethermint.EVMTxIndexer var idxer laconicd.EVMTxIndexer
if config.JSONRPC.EnableIndexer { if config.JSONRPC.EnableIndexer {
idxDB, err := OpenIndexerDB(home, server.GetAppDBBackend(ctx.Viper)) idxDB, err := OpenIndexerDB(home, server.GetAppDBBackend(ctx.Viper))
if err != nil { if err != nil {

View File

@ -24,7 +24,7 @@ init:
address: "0.0.0.0:8545" # change the JSON-RPC address and port address: "0.0.0.0:8545" # change the JSON-RPC address and port
ws-address: "0.0.0.0:8546" # change the JSON-RPC websocket address and port ws-address: "0.0.0.0:8546" # change the JSON-RPC websocket address and port
genesis: genesis:
chain_id: "ethermint_9000-1" chain_id: "laconic_9000-1"
app_state: app_state:
staking: staking:
params: params:

View File

@ -31,7 +31,7 @@ import (
"github.com/cerc-io/laconicd/server/config" "github.com/cerc-io/laconicd/server/config"
"github.com/cerc-io/laconicd/testutil/network" "github.com/cerc-io/laconicd/testutil/network"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
// var _ = Describe("E2e", func() { // var _ = Describe("E2e", func() {
@ -84,7 +84,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
s.rpcClient = rpcClient s.rpcClient = rpcClient
s.gethClient = gethclient.New(rpcClient) s.gethClient = gethclient.New(rpcClient)
s.Require().NotNil(s.gethClient) s.Require().NotNil(s.gethClient)
chainId, err := ethermint.ParseChainID(s.cfg.ChainID) chainId, err := laconicd.ParseChainID(s.cfg.ChainID)
s.Require().NoError(err) s.Require().NoError(err)
s.ethSigner = ethtypes.LatestSignerForChainID(chainId) s.ethSigner = ethtypes.LatestSignerForChainID(chainId)
} }
@ -99,9 +99,9 @@ func (s *IntegrationTestSuite) TestChainID() {
s.T().Log(chainID.Int64()) s.T().Log(chainID.Int64())
eip155ChainID, err := ethermint.ParseChainID(s.network.Config.ChainID) eip155ChainID, err := laconicd.ParseChainID(s.network.Config.ChainID)
s.Require().NoError(err) s.Require().NoError(err)
eip155ChainIDGen, err := ethermint.ParseChainID(genesisRes.Genesis.ChainID) eip155ChainIDGen, err := laconicd.ParseChainID(genesisRes.Genesis.ChainID)
s.Require().NoError(err) s.Require().NoError(err)
s.Require().Equal(chainID, eip155ChainID) s.Require().Equal(chainID, eip155ChainID)

View File

@ -52,7 +52,7 @@ func init() {
type ImporterTestSuite struct { type ImporterTestSuite struct {
suite.Suite suite.Suite
app *app.EthermintApp app *app.LaconicApp
ctx sdk.Context ctx sdk.Context
} }
@ -66,7 +66,7 @@ func (suite *ImporterTestSuite) DoSetupTest(t require.TestingT) {
consAddress := sdk.ConsAddress(priv.PubKey().Address()) consAddress := sdk.ConsAddress(priv.PubKey().Address())
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{ suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{
Height: 1, Height: 1,
ChainID: "ethermint_9000-1", ChainID: "laconic_9000-1",
Time: time.Now().UTC(), Time: time.Now().UTC(),
ProposerAddress: consAddress.Bytes(), ProposerAddress: consAddress.Bytes(),
Version: tmversion.Consensus{ Version: tmversion.Consensus{

View File

@ -1,7 +1,7 @@
local config = import 'default.jsonnet'; local config = import 'default.jsonnet';
config { config {
'ethermint_9000-1'+: { 'laconic_9000-1'+: {
genesis+: { genesis+: {
app_state+: { app_state+: {
feemarket+: { feemarket+: {

View File

@ -1,6 +1,6 @@
{ {
dotenv: '../../../scripts/.env', dotenv: '../../../scripts/.env',
'ethermint_9000-1': { 'laconic_9000-1': {
cmd: 'laconicd', cmd: 'laconicd',
'start-flags': '--trace', 'start-flags': '--trace',
config: { config: {

View File

@ -1,7 +1,7 @@
local config = import 'default.jsonnet'; local config = import 'default.jsonnet';
config { config {
'ethermint_9000-1'+: { 'laconic_9000-1'+: {
config+: { config+: {
tx_index+: { tx_index+: {
indexer: 'null', indexer: 'null',

View File

@ -1,7 +1,7 @@
local config = import 'default.jsonnet'; local config = import 'default.jsonnet';
config { config {
'ethermint_9000-1'+: { 'laconic_9000-1'+: {
'app-config'+: { 'app-config'+: {
pruning: 'everything', pruning: 'everything',
'state-sync'+: { 'state-sync'+: {

View File

@ -1,7 +1,7 @@
local config = import 'default.jsonnet'; local config = import 'default.jsonnet';
config { config {
'ethermint_9000-1'+: { 'laconic_9000-1'+: {
validators: super.validators + [{ validators: super.validators + [{
name: 'fullnode', name: 'fullnode',
}], }],

View File

@ -130,7 +130,7 @@ def setup_custom_ethermint(
wait_for_port(ports.evmrpc_port(base_port)) wait_for_port(ports.evmrpc_port(base_port))
wait_for_port(ports.evmrpc_ws_port(base_port)) wait_for_port(ports.evmrpc_ws_port(base_port))
yield Ethermint( yield Ethermint(
path / "ethermint_9000-1", chain_binary=chain_binary or DEFAULT_CHAIN_BINARY path / "laconic_9000-1", chain_binary=chain_binary or DEFAULT_CHAIN_BINARY
) )
finally: finally:
os.killpg(os.getpgid(proc.pid), signal.SIGTERM) os.killpg(os.getpgid(proc.pid), signal.SIGTERM)

View File

@ -15,7 +15,7 @@ def update_node2_cmd(path, cmd, i):
ini = configparser.RawConfigParser() ini = configparser.RawConfigParser()
ini.read(ini_path) ini.read(ini_path)
for section in ini.sections(): for section in ini.sections():
if section == f"program:ethermint_9000-1-node{i}": if section == f"program:laconic_9000-1-node{i}":
ini[section].update( ini[section].update(
{ {
"command": f"{cmd} start --home %(here)s/node{i}", "command": f"{cmd} start --home %(here)s/node{i}",
@ -28,7 +28,7 @@ def update_node2_cmd(path, cmd, i):
def post_init(broken_binary): def post_init(broken_binary):
def inner(path, base_port, config): def inner(path, base_port, config):
chain_id = "ethermint_9000-1" chain_id = "laconic_9000-1"
update_node2_cmd(path / chain_id, broken_binary, 2) update_node2_cmd(path / chain_id, broken_binary, 2)
return inner return inner
@ -82,7 +82,7 @@ def test_rollback(custom_ethermint):
print("stop node2") print("stop node2")
supervisorctl( supervisorctl(
custom_ethermint.base_dir / "../tasks.ini", "stop", "ethermint_9000-1-node2" custom_ethermint.base_dir / "../tasks.ini", "stop", "laconic_9000-1-node2"
) )
print("do rollback on node2") print("do rollback on node2")

View File

@ -36,7 +36,7 @@ def post_init(path, base_port, config):
""" """
prepare cosmovisor for each node prepare cosmovisor for each node
""" """
chain_id = "ethermint_9000-1" chain_id = "laconic_9000-1"
cfg = json.loads((path / chain_id / "config.json").read_text()) cfg = json.loads((path / chain_id / "config.json").read_text())
for i, _ in enumerate(cfg["validators"]): for i, _ in enumerate(cfg["validators"]):
home = path / chain_id / f"node{i}" home = path / chain_id / f"node{i}"

View File

@ -18,7 +18,7 @@ import (
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
rpctypes "github.com/cerc-io/laconicd/rpc/types" rpctypes "github.com/cerc-io/laconicd/rpc/types"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
@ -134,7 +134,7 @@ func callWithError(method string, params interface{}) (*Response, error) {
} }
func TestEth_protocolVersion(t *testing.T) { func TestEth_protocolVersion(t *testing.T) {
expectedRes := hexutil.Uint(ethermint.ProtocolVersion) expectedRes := hexutil.Uint(laconicd.ProtocolVersion)
rpcRes := call(t, "eth_protocolVersion", []string{}) rpcRes := call(t, "eth_protocolVersion", []string{})

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
CHAINID="ethermint_9000-1" CHAINID="laconic_9000-1"
MONIKER="localtestnet" MONIKER="localtestnet"
# localKey address 0x7cb61d4117ae31a12e393a1cfa3bac666481d02e # localKey address 0x7cb61d4117ae31a12e393a1cfa3bac666481d02e

View File

@ -52,7 +52,7 @@ import (
"github.com/cerc-io/laconicd/crypto/hd" "github.com/cerc-io/laconicd/crypto/hd"
"github.com/cerc-io/laconicd/encoding" "github.com/cerc-io/laconicd/encoding"
"github.com/cerc-io/laconicd/server/config" "github.com/cerc-io/laconicd/server/config"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
"github.com/cerc-io/laconicd/app" "github.com/cerc-io/laconicd/app"
@ -68,7 +68,7 @@ type AppConstructor = func(val Validator) servertypes.Application
// NewAppConstructor returns a new simapp AppConstructor // NewAppConstructor returns a new simapp AppConstructor
func NewAppConstructor(encodingCfg params.EncodingConfig) AppConstructor { func NewAppConstructor(encodingCfg params.EncodingConfig) AppConstructor {
return func(val Validator) servertypes.Application { return func(val Validator) servertypes.Application {
return app.NewEthermintApp( return app.NewLaconicApp(
val.Ctx.Logger, dbm.NewMemDB(), nil, true, make(map[int64]bool), val.Ctx.Config.RootDir, 0, val.Ctx.Logger, dbm.NewMemDB(), nil, true, make(map[int64]bool), val.Ctx.Config.RootDir, 0,
encodingCfg, encodingCfg,
simapp.EmptyAppOptions{}, simapp.EmptyAppOptions{},
@ -122,13 +122,13 @@ func DefaultConfig() Config {
AppConstructor: NewAppConstructor(encCfg), AppConstructor: NewAppConstructor(encCfg),
GenesisState: app.ModuleBasics.DefaultGenesis(encCfg.Codec), GenesisState: app.ModuleBasics.DefaultGenesis(encCfg.Codec),
TimeoutCommit: 2 * time.Second, TimeoutCommit: 2 * time.Second,
ChainID: fmt.Sprintf("ethermint_%d-1", tmrand.Int63n(9999999999999)+1), ChainID: fmt.Sprintf("laconic_%d-1", tmrand.Int63n(9999999999999)+1),
NumValidators: 4, NumValidators: 4,
BondDenom: ethermint.AttoPhoton, BondDenom: laconicd.AttoPhoton,
MinGasPrices: fmt.Sprintf("0.000006%s", ethermint.AttoPhoton), MinGasPrices: fmt.Sprintf("0.000006%s", laconicd.AttoPhoton),
AccountTokens: sdk.TokensFromConsensusPower(1000, ethermint.PowerReduction), AccountTokens: sdk.TokensFromConsensusPower(1000, laconicd.PowerReduction),
StakingTokens: sdk.TokensFromConsensusPower(500, ethermint.PowerReduction), StakingTokens: sdk.TokensFromConsensusPower(500, laconicd.PowerReduction),
BondedTokens: sdk.TokensFromConsensusPower(100, ethermint.PowerReduction), BondedTokens: sdk.TokensFromConsensusPower(100, laconicd.PowerReduction),
PruningStrategy: pruningtypes.PruningOptionNothing, PruningStrategy: pruningtypes.PruningOptionNothing,
CleanupDir: true, CleanupDir: true,
SigningAlgo: string(hd.EthSecp256k1Type), SigningAlgo: string(hd.EthSecp256k1Type),
@ -218,7 +218,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
l.Log("acquiring test network lock") l.Log("acquiring test network lock")
lock.Lock() lock.Lock()
if !ethermint.IsValidChainID(cfg.ChainID) { if !laconicd.IsValidChainID(cfg.ChainID) {
return nil, fmt.Errorf("invalid chain-id: %s", cfg.ChainID) return nil, fmt.Errorf("invalid chain-id: %s", cfg.ChainID)
} }
@ -412,7 +412,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
genFiles = append(genFiles, tmCfg.GenesisFile()) genFiles = append(genFiles, tmCfg.GenesisFile())
genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: balances.Sort()}) genBalances = append(genBalances, banktypes.Balance{Address: addr.String(), Coins: balances.Sort()})
genAccounts = append(genAccounts, &ethermint.EthAccount{ genAccounts = append(genAccounts, &laconicd.EthAccount{
BaseAccount: authtypes.NewBaseAccount(addr, nil, 0, 0), BaseAccount: authtypes.NewBaseAccount(addr, nil, 0, 0),
CodeHash: common.BytesToHash(evmtypes.EmptyCodeHash).Hex(), CodeHash: common.BytesToHash(evmtypes.EmptyCodeHash).Hex(),
}) })
@ -470,7 +470,7 @@ func New(l Logger, baseDir string, cfg Config) (*Network, error) {
return nil, err return nil, err
} }
customAppTemplate, _ := config.AppConfig(ethermint.AttoPhoton) customAppTemplate, _ := config.AppConfig(laconicd.AttoPhoton)
srvconfig.SetConfigTemplate(customAppTemplate) srvconfig.SetConfigTemplate(customAppTemplate)
srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), appCfg) srvconfig.WriteConfigFile(filepath.Join(nodeDir, "config/app.toml"), appCfg)

View File

@ -14,7 +14,7 @@ import (
cryptocodec "github.com/cerc-io/laconicd/crypto/codec" cryptocodec "github.com/cerc-io/laconicd/crypto/codec"
"github.com/cerc-io/laconicd/crypto/ethsecp256k1" "github.com/cerc-io/laconicd/crypto/ethsecp256k1"
ethermintcodec "github.com/cerc-io/laconicd/encoding/codec" laconicdcodec "github.com/cerc-io/laconicd/encoding/codec"
"github.com/cerc-io/laconicd/types" "github.com/cerc-io/laconicd/types"
) )
@ -42,7 +42,7 @@ func (suite *AccountTestSuite) SetupTest() {
} }
interfaceRegistry := codectypes.NewInterfaceRegistry() interfaceRegistry := codectypes.NewInterfaceRegistry()
ethermintcodec.RegisterInterfaces(interfaceRegistry) laconicdcodec.RegisterInterfaces(interfaceRegistry)
suite.cdc = codec.NewProtoCodec(interfaceRegistry) suite.cdc = codec.NewProtoCodec(interfaceRegistry)
} }

View File

@ -9,7 +9,7 @@ func BenchmarkParseChainID(b *testing.B) {
b.ReportAllocs() b.ReportAllocs()
// Start at 1, for valid EIP155, see regexEIP155 variable. // Start at 1, for valid EIP155, see regexEIP155 variable.
for i := 1; i < b.N; i++ { for i := 1; i < b.N; i++ {
chainID := fmt.Sprintf("ethermint_1-%d", i) chainID := fmt.Sprintf("laconic_1-%d", i)
if _, err := ParseChainID(chainID); err != nil { if _, err := ParseChainID(chainID); err != nil {
b.Fatal(err) b.Fatal(err)
} }

View File

@ -15,7 +15,7 @@ var (
regexEIP155 = `[1-9][0-9]*` regexEIP155 = `[1-9][0-9]*`
regexEpochSeparator = `-{1}` regexEpochSeparator = `-{1}`
regexEpoch = `[1-9][0-9]*` regexEpoch = `[1-9][0-9]*`
ethermintChainID = regexp.MustCompile(fmt.Sprintf(`^(%s)%s(%s)%s(%s)$`, laconicChainID = regexp.MustCompile(fmt.Sprintf(`^(%s)%s(%s)%s(%s)$`,
regexChainID, regexChainID,
regexEIP155Separator, regexEIP155Separator,
regexEIP155, regexEIP155,
@ -29,7 +29,7 @@ func IsValidChainID(chainID string) bool {
return false return false
} }
return ethermintChainID.MatchString(chainID) return laconicChainID.MatchString(chainID)
} }
// ParseChainID parses a string chain identifier's epoch to an Ethereum-compatible // ParseChainID parses a string chain identifier's epoch to an Ethereum-compatible
@ -40,7 +40,7 @@ func ParseChainID(chainID string) (*big.Int, error) {
return nil, sdkerrors.Wrapf(ErrInvalidChainID, "chain-id '%s' cannot exceed 48 chars", chainID) return nil, sdkerrors.Wrapf(ErrInvalidChainID, "chain-id '%s' cannot exceed 48 chars", chainID)
} }
matches := ethermintChainID.FindStringSubmatch(chainID) matches := laconicChainID.FindStringSubmatch(chainID)
if matches == nil || len(matches) != 4 || matches[1] == "" { if matches == nil || len(matches) != 4 || matches[1] == "" {
return nil, sdkerrors.Wrapf(ErrInvalidChainID, "%s: %v", chainID, matches) return nil, sdkerrors.Wrapf(ErrInvalidChainID, "%s: %v", chainID, matches)
} }

View File

@ -16,7 +16,7 @@ func TestParseChainID(t *testing.T) {
expInt *big.Int expInt *big.Int
}{ }{
{ {
"valid chain-id, single digit", "ethermint_1-1", false, big.NewInt(1), "valid chain-id, single digit", "laconic_1-1", false, big.NewInt(1),
}, },
{ {
"valid chain-id, multiple digits", "aragonchain_256-1", false, big.NewInt(256), "valid chain-id, multiple digits", "aragonchain_256-1", false, big.NewInt(256),
@ -37,25 +37,25 @@ func TestParseChainID(t *testing.T) {
"invalid chain-id, undefined identifier", "_1-1", true, nil, "invalid chain-id, undefined identifier", "_1-1", true, nil,
}, },
{ {
"invalid chain-id, uppercases", "ETHERMINT_1-1", true, nil, "invalid chain-id, uppercases", "LACONIC_1-1", true, nil,
}, },
{ {
"invalid chain-id, mixed cases", "Ethermint_1-1", true, nil, "invalid chain-id, mixed cases", "Laconic_1-1", true, nil,
}, },
{ {
"invalid chain-id, special chars", "$&*#!_1-1", true, nil, "invalid chain-id, special chars", "$&*#!_1-1", true, nil,
}, },
{ {
"invalid eip155 chain-id, cannot start with 0", "ethermint_001-1", true, nil, "invalid eip155 chain-id, cannot start with 0", "laconic_001-1", true, nil,
}, },
{ {
"invalid eip155 chain-id, cannot invalid base", "ethermint_0x212-1", true, nil, "invalid eip155 chain-id, cannot invalid base", "laconic_0x212-1", true, nil,
}, },
{ {
"invalid eip155 chain-id, non-integer", "ethermint_ethermint_9000-1", true, nil, "invalid eip155 chain-id, non-integer", "ethermint_laconic_9000-1", true, nil,
}, },
{ {
"invalid epoch, undefined", "ethermint_-", true, nil, "invalid epoch, undefined", "laconic_-", true, nil,
}, },
{ {
"blank chain ID", " ", true, nil, "blank chain ID", " ", true, nil,
@ -67,7 +67,7 @@ func TestParseChainID(t *testing.T) {
"empty content for chain id, eip155 and epoch numbers", "_-", true, nil, "empty content for chain id, eip155 and epoch numbers", "_-", true, nil,
}, },
{ {
"long chain-id", "ethermint_" + strings.Repeat("1", 40) + "-1", true, nil, "long chain-id", "laconic_" + strings.Repeat("1", 40) + "-1", true, nil,
}, },
} }

View File

@ -6,7 +6,7 @@ import (
const ( const (
// RootCodespace is the codespace for all errors defined in this package // RootCodespace is the codespace for all errors defined in this package
RootCodespace = "ethermint" RootCodespace = "laconicd"
) )
// NOTE: We can't use 1 since that error code is reserved for internal errors. // NOTE: We can't use 1 since that error code is reserved for internal errors.

View File

@ -20,7 +20,7 @@ The following steps need to be followed only before running the chain for the fi
Keep a note of the keyring passphrase if you set it. Keep a note of the keyring passphrase if you set it.
2. Init the chain: 2. Init the chain:
``` ```
./build/laconicd init test-moniker --chain-id ethermint_9000-1 ./build/laconicd init test-moniker --chain-id laconic_9000-1
``` ```
3. Add genesis account: 3. Add genesis account:
``` ```
@ -28,7 +28,7 @@ The following steps need to be followed only before running the chain for the fi
``` ```
4. Make a genesis tx: 4. Make a genesis tx:
``` ```
./build/laconicd gentx root 1000000000000000000stake --chain-id ethermint_9000-1 ./build/laconicd gentx root 1000000000000000000stake --chain-id laconic_9000-1
``` ```
5. Collect gentxs: 5. Collect gentxs:
``` ```

View File

@ -16,13 +16,13 @@ import (
type KeeperTestSuite struct { type KeeperTestSuite struct {
suite.Suite suite.Suite
app *app.EthermintApp app *app.LaconicApp
ctx sdk.Context ctx sdk.Context
queryClient types.QueryClient queryClient types.QueryClient
} }
func (suite *KeeperTestSuite) SetupTest() { func (suite *KeeperTestSuite) SetupTest() {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState { testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis return genesis
}) })
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{}) ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
@ -37,7 +37,7 @@ func (suite *KeeperTestSuite) SetupTest() {
} }
func TestParams(t *testing.T) { func TestParams(t *testing.T) {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState { testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis return genesis
}) })
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{}) ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})

View File

@ -9,9 +9,9 @@ $ make build
```bash ```bash
./build/laconicd keys add root ./build/laconicd keys add root
./build/laconicd init test-moniker --chain-id ethermint_9000-1 ./build/laconicd init test-moniker --chain-id laconic_9000-1
./build/laconicd add-genesis-account $(./build/laconicd keys show root -a) 1000000000000000000aphoton,1000000000000000000stake ./build/laconicd add-genesis-account $(./build/laconicd keys show root -a) 1000000000000000000aphoton,1000000000000000000stake
./build/laconicd gentx root 1000000000000000000stake --chain-id ethermint_9000-1 ./build/laconicd gentx root 1000000000000000000stake --chain-id laconic_9000-1
./build/laconicd collect-gentxs ./build/laconicd collect-gentxs
./build/laconicd start ./build/laconicd start
``` ```

View File

@ -16,13 +16,13 @@ import (
type KeeperTestSuite struct { type KeeperTestSuite struct {
suite.Suite suite.Suite
app *app.EthermintApp app *app.LaconicApp
ctx sdk.Context ctx sdk.Context
queryClient types.QueryClient queryClient types.QueryClient
} }
func (suite *KeeperTestSuite) SetupTest() { func (suite *KeeperTestSuite) SetupTest() {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState { testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis return genesis
}) })
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{}) ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
@ -37,7 +37,7 @@ func (suite *KeeperTestSuite) SetupTest() {
} }
func TestParams(t *testing.T) { func TestParams(t *testing.T) {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState { testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis return genesis
}) })
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{}) ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})

View File

@ -11,7 +11,7 @@ import (
) )
func TestItCreatesModuleAccountOnInitBlock(t *testing.T) { func TestItCreatesModuleAccountOnInitBlock(t *testing.T) {
app := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState { app := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis return genesis
}) })
ctx := app.BaseApp.NewContext(false, tmproto.Header{}) ctx := app.BaseApp.NewContext(false, tmproto.Header{})

View File

@ -10,7 +10,7 @@ import (
"github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/crypto"
abci "github.com/tendermint/tendermint/abci/types" abci "github.com/tendermint/tendermint/abci/types"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm/keeper" "github.com/cerc-io/laconicd/x/evm/keeper"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
) )
@ -40,7 +40,7 @@ func InitGenesis(
panic(fmt.Errorf("account not found for address %s", account.Address)) panic(fmt.Errorf("account not found for address %s", account.Address))
} }
ethAcct, ok := acc.(ethermint.EthAccountI) ethAcct, ok := acc.(laconicd.EthAccountI)
if !ok { if !ok {
panic( panic(
fmt.Errorf("account %s must be an EthAccount interface, got %T", fmt.Errorf("account %s must be an EthAccount interface, got %T",
@ -69,7 +69,7 @@ func InitGenesis(
func ExportGenesis(ctx sdk.Context, k *keeper.Keeper, ak types.AccountKeeper) *types.GenesisState { func ExportGenesis(ctx sdk.Context, k *keeper.Keeper, ak types.AccountKeeper) *types.GenesisState {
var ethGenAccounts []types.GenesisAccount var ethGenAccounts []types.GenesisAccount
ak.IterateAccounts(ctx, func(account authtypes.AccountI) bool { ak.IterateAccounts(ctx, func(account authtypes.AccountI) bool {
ethAccount, ok := account.(ethermint.EthAccountI) ethAccount, ok := account.(laconicd.EthAccountI)
if !ok { if !ok {
// ignore non EthAccounts // ignore non EthAccounts
return false return false

View File

@ -33,7 +33,7 @@ import (
"github.com/cerc-io/laconicd/app" "github.com/cerc-io/laconicd/app"
"github.com/cerc-io/laconicd/crypto/ethsecp256k1" "github.com/cerc-io/laconicd/crypto/ethsecp256k1"
"github.com/cerc-io/laconicd/tests" "github.com/cerc-io/laconicd/tests"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm" "github.com/cerc-io/laconicd/x/evm"
"github.com/cerc-io/laconicd/x/evm/statedb" "github.com/cerc-io/laconicd/x/evm/statedb"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
@ -50,7 +50,7 @@ type EvmTestSuite struct {
ctx sdk.Context ctx sdk.Context
handler sdk.Handler handler sdk.Handler
app *app.EthermintApp app *app.LaconicApp
codec codec.Codec codec codec.Codec
chainID *big.Int chainID *big.Int
@ -77,7 +77,7 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {
require.NoError(t, err) require.NoError(t, err)
consAddress := sdk.ConsAddress(priv.PubKey().Address()) consAddress := sdk.ConsAddress(priv.PubKey().Address())
suite.app = app.Setup(checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState { suite.app = app.Setup(checkTx, func(app *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
if suite.dynamicTxFee { if suite.dynamicTxFee {
feemarketGenesis := feemarkettypes.DefaultGenesisState() feemarketGenesis := feemarkettypes.DefaultGenesisState()
feemarketGenesis.Params.EnableHeight = 1 feemarketGenesis.Params.EnableHeight = 1
@ -113,7 +113,7 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {
// Initialize the chain // Initialize the chain
suite.app.InitChain( suite.app.InitChain(
abci.RequestInitChain{ abci.RequestInitChain{
ChainId: "ethermint_9000-1", ChainId: "laconic_9000-1",
Validators: []abci.ValidatorUpdate{}, Validators: []abci.ValidatorUpdate{},
ConsensusParams: app.DefaultConsensusParams, ConsensusParams: app.DefaultConsensusParams,
AppStateBytes: stateBytes, AppStateBytes: stateBytes,
@ -122,7 +122,7 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{ suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{
Height: 1, Height: 1,
ChainID: "ethermint_9000-1", ChainID: "laconic_9000-1",
Time: time.Now().UTC(), Time: time.Now().UTC(),
ProposerAddress: consAddress.Bytes(), ProposerAddress: consAddress.Bytes(),
Version: tmversion.Consensus{ Version: tmversion.Consensus{
@ -147,7 +147,7 @@ func (suite *EvmTestSuite) DoSetupTest(t require.TestingT) {
queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry()) queryHelper := baseapp.NewQueryServerTestHelper(suite.ctx, suite.app.InterfaceRegistry())
types.RegisterQueryServer(queryHelper, suite.app.EvmKeeper) types.RegisterQueryServer(queryHelper, suite.app.EvmKeeper)
acc := &ethermint.EthAccount{ acc := &laconicd.EthAccount{
BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(address.Bytes()), nil, 0, 0), BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(address.Bytes()), nil, 0, 0),
CodeHash: common.BytesToHash(crypto.Keccak256(nil)).String(), CodeHash: common.BytesToHash(crypto.Keccak256(nil)).String(),
} }

View File

@ -11,7 +11,7 @@ import (
authante "github.com/cosmos/cosmos-sdk/x/auth/ante" authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
ethtypes "github.com/ethereum/go-ethereum/core/types" ethtypes "github.com/ethereum/go-ethereum/core/types"
) )
@ -20,7 +20,7 @@ func SetupContract(b *testing.B) (*KeeperTestSuite, common.Address) {
suite := KeeperTestSuite{} suite := KeeperTestSuite{}
suite.SetupTest() suite.SetupTest()
amt := sdk.Coins{ethermint.NewPhotonCoinInt64(1000000000000000000)} amt := sdk.Coins{laconicd.NewPhotonCoinInt64(1000000000000000000)}
err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt) err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt)
require.NoError(b, err) require.NoError(b, err)
err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt) err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt)
@ -36,7 +36,7 @@ func SetupTestMessageCall(b *testing.B) (*KeeperTestSuite, common.Address) {
suite := KeeperTestSuite{} suite := KeeperTestSuite{}
suite.SetupTest() suite.SetupTest()
amt := sdk.Coins{ethermint.NewPhotonCoinInt64(1000000000000000000)} amt := sdk.Coins{laconicd.NewPhotonCoinInt64(1000000000000000000)}
err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt) err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt)
require.NoError(b, err) require.NoError(b, err)
err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt) err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt)

View File

@ -25,7 +25,7 @@ import (
"github.com/ethereum/go-ethereum/core/vm" "github.com/ethereum/go-ethereum/core/vm"
ethparams "github.com/ethereum/go-ethereum/params" ethparams "github.com/ethereum/go-ethereum/params"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm/statedb" "github.com/cerc-io/laconicd/x/evm/statedb"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
) )
@ -42,7 +42,7 @@ func (k Keeper) Account(c context.Context, req *types.QueryAccountRequest) (*typ
return nil, status.Error(codes.InvalidArgument, "empty request") return nil, status.Error(codes.InvalidArgument, "empty request")
} }
if err := ethermint.ValidateAddress(req.Address); err != nil { if err := laconicd.ValidateAddress(req.Address); err != nil {
return nil, status.Error( return nil, status.Error(
codes.InvalidArgument, err.Error(), codes.InvalidArgument, err.Error(),
) )
@ -65,7 +65,7 @@ func (k Keeper) CosmosAccount(c context.Context, req *types.QueryCosmosAccountRe
return nil, status.Error(codes.InvalidArgument, "empty request") return nil, status.Error(codes.InvalidArgument, "empty request")
} }
if err := ethermint.ValidateAddress(req.Address); err != nil { if err := laconicd.ValidateAddress(req.Address); err != nil {
return nil, status.Error( return nil, status.Error(
codes.InvalidArgument, err.Error(), codes.InvalidArgument, err.Error(),
) )
@ -130,7 +130,7 @@ func (k Keeper) Balance(c context.Context, req *types.QueryBalanceRequest) (*typ
return nil, status.Error(codes.InvalidArgument, "empty request") return nil, status.Error(codes.InvalidArgument, "empty request")
} }
if err := ethermint.ValidateAddress(req.Address); err != nil { if err := laconicd.ValidateAddress(req.Address); err != nil {
return nil, status.Error( return nil, status.Error(
codes.InvalidArgument, codes.InvalidArgument,
types.ErrZeroAddress.Error(), types.ErrZeroAddress.Error(),
@ -152,7 +152,7 @@ func (k Keeper) Storage(c context.Context, req *types.QueryStorageRequest) (*typ
return nil, status.Error(codes.InvalidArgument, "empty request") return nil, status.Error(codes.InvalidArgument, "empty request")
} }
if err := ethermint.ValidateAddress(req.Address); err != nil { if err := laconicd.ValidateAddress(req.Address); err != nil {
return nil, status.Error( return nil, status.Error(
codes.InvalidArgument, codes.InvalidArgument,
types.ErrZeroAddress.Error(), types.ErrZeroAddress.Error(),
@ -178,7 +178,7 @@ func (k Keeper) Code(c context.Context, req *types.QueryCodeRequest) (*types.Que
return nil, status.Error(codes.InvalidArgument, "empty request") return nil, status.Error(codes.InvalidArgument, "empty request")
} }
if err := ethermint.ValidateAddress(req.Address); err != nil { if err := laconicd.ValidateAddress(req.Address); err != nil {
return nil, status.Error( return nil, status.Error(
codes.InvalidArgument, codes.InvalidArgument,
types.ErrZeroAddress.Error(), types.ErrZeroAddress.Error(),

View File

@ -19,7 +19,7 @@ import (
"github.com/cerc-io/laconicd/crypto/ethsecp256k1" "github.com/cerc-io/laconicd/crypto/ethsecp256k1"
"github.com/cerc-io/laconicd/server/config" "github.com/cerc-io/laconicd/server/config"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
) )
@ -54,7 +54,7 @@ func (suite *KeeperTestSuite) TestQueryAccount() {
{ {
"success", "success",
func() { func() {
amt := sdk.Coins{ethermint.NewPhotonCoinInt64(100)} amt := sdk.Coins{laconicd.NewPhotonCoinInt64(100)}
err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt) err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt)
suite.Require().NoError(err) suite.Require().NoError(err)
err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt) err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt)
@ -195,7 +195,7 @@ func (suite *KeeperTestSuite) TestQueryBalance() {
{ {
"success", "success",
func() { func() {
amt := sdk.Coins{ethermint.NewPhotonCoinInt64(100)} amt := sdk.Coins{laconicd.NewPhotonCoinInt64(100)}
err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt) err := suite.app.BankKeeper.MintCoins(suite.ctx, types.ModuleName, amt)
suite.Require().NoError(err) suite.Require().NoError(err)
err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt) err = suite.app.BankKeeper.SendCoinsFromModuleToAccount(suite.ctx, types.ModuleName, suite.address.Bytes(), amt)

View File

@ -168,7 +168,7 @@ func setupChain(localMinGasPricesStr string) {
// Initialize the app, so we can use SetMinGasPrices to set the // Initialize the app, so we can use SetMinGasPrices to set the
// validator-specific min-gas-prices setting // validator-specific min-gas-prices setting
db := dbm.NewMemDB() db := dbm.NewMemDB()
newapp := app.NewEthermintApp( newapp := app.NewLaconicApp(
log.NewNopLogger(), log.NewNopLogger(),
db, db,
nil, nil,
@ -190,7 +190,7 @@ func setupChain(localMinGasPricesStr string) {
// Initialize the chain // Initialize the chain
newapp.InitChain( newapp.InitChain(
abci.RequestInitChain{ abci.RequestInitChain{
ChainId: "ethermint_9000-1", ChainId: "laconic_9000-1",
Validators: []abci.ValidatorUpdate{}, Validators: []abci.ValidatorUpdate{},
AppStateBytes: stateBytes, AppStateBytes: stateBytes,
ConsensusParams: app.DefaultConsensusParams, ConsensusParams: app.DefaultConsensusParams,

View File

@ -16,7 +16,7 @@ import (
"github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/params"
"github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/libs/log"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm/statedb" "github.com/cerc-io/laconicd/x/evm/statedb"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
evm "github.com/cerc-io/laconicd/x/evm/vm" evm "github.com/cerc-io/laconicd/x/evm/vm"
@ -109,7 +109,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger {
// WithChainID sets the chain id to the local variable in the keeper // WithChainID sets the chain id to the local variable in the keeper
func (k *Keeper) WithChainID(ctx sdk.Context) { func (k *Keeper) WithChainID(ctx sdk.Context) {
chainID, err := ethermint.ParseChainID(ctx.ChainID()) chainID, err := laconicd.ParseChainID(ctx.ChainID())
if err != nil { if err != nil {
panic(err) panic(err)
} }
@ -258,7 +258,7 @@ func (k *Keeper) GetAccountWithoutBalance(ctx sdk.Context, addr common.Address)
} }
codeHash := types.EmptyCodeHash codeHash := types.EmptyCodeHash
ethAcct, ok := acct.(ethermint.EthAccountI) ethAcct, ok := acct.(laconicd.EthAccountI)
if ok { if ok {
codeHash = ethAcct.GetCodeHash().Bytes() codeHash = ethAcct.GetCodeHash().Bytes()
} }

View File

@ -32,7 +32,7 @@ import (
"github.com/cerc-io/laconicd/encoding" "github.com/cerc-io/laconicd/encoding"
"github.com/cerc-io/laconicd/server/config" "github.com/cerc-io/laconicd/server/config"
"github.com/cerc-io/laconicd/tests" "github.com/cerc-io/laconicd/tests"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm/statedb" "github.com/cerc-io/laconicd/x/evm/statedb"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
@ -56,7 +56,7 @@ type KeeperTestSuite struct {
suite.Suite suite.Suite
ctx sdk.Context ctx sdk.Context
app *app.EthermintApp app *app.LaconicApp
queryClient types.QueryClient queryClient types.QueryClient
address common.Address address common.Address
consAddress sdk.ConsAddress consAddress sdk.ConsAddress
@ -110,7 +110,7 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool) {
require.NoError(t, err) require.NoError(t, err)
suite.consAddress = sdk.ConsAddress(priv.PubKey().Address()) suite.consAddress = sdk.ConsAddress(priv.PubKey().Address())
suite.app = app.Setup(checkTx, func(app *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState { suite.app = app.Setup(checkTx, func(app *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
feemarketGenesis := feemarkettypes.DefaultGenesisState() feemarketGenesis := feemarkettypes.DefaultGenesisState()
if suite.enableFeemarket { if suite.enableFeemarket {
feemarketGenesis.Params.EnableHeight = 1 feemarketGenesis.Params.EnableHeight = 1
@ -155,7 +155,7 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool) {
// Initialize the chain // Initialize the chain
suite.app.InitChain( suite.app.InitChain(
abci.RequestInitChain{ abci.RequestInitChain{
ChainId: "ethermint_9000-1", ChainId: "laconic_9000-1",
Validators: []abci.ValidatorUpdate{}, Validators: []abci.ValidatorUpdate{},
ConsensusParams: app.DefaultConsensusParams, ConsensusParams: app.DefaultConsensusParams,
AppStateBytes: stateBytes, AppStateBytes: stateBytes,
@ -165,7 +165,7 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool) {
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{ suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{
Height: 1, Height: 1,
ChainID: "ethermint_9000-1", ChainID: "laconic_9000-1",
Time: time.Now().UTC(), Time: time.Now().UTC(),
ProposerAddress: suite.consAddress.Bytes(), ProposerAddress: suite.consAddress.Bytes(),
Version: tmversion.Consensus{ Version: tmversion.Consensus{
@ -191,7 +191,7 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool) {
types.RegisterQueryServer(queryHelper, suite.app.EvmKeeper) types.RegisterQueryServer(queryHelper, suite.app.EvmKeeper)
suite.queryClient = types.NewQueryClient(queryHelper) suite.queryClient = types.NewQueryClient(queryHelper)
acc := &ethermint.EthAccount{ acc := &laconicd.EthAccount{
BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(suite.address.Bytes()), nil, 0, 0), BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(suite.address.Bytes()), nil, 0, 0),
CodeHash: common.BytesToHash(crypto.Keccak256(nil)).String(), CodeHash: common.BytesToHash(crypto.Keccak256(nil)).String(),
} }

View File

@ -13,7 +13,7 @@ import (
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm/statedb" "github.com/cerc-io/laconicd/x/evm/statedb"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
evm "github.com/cerc-io/laconicd/x/evm/vm" evm "github.com/cerc-io/laconicd/x/evm/vm"
@ -84,7 +84,7 @@ func (k *Keeper) NewEVM(
Transfer: core.Transfer, Transfer: core.Transfer,
GetHash: k.GetHashFn(ctx), GetHash: k.GetHashFn(ctx),
Coinbase: cfg.CoinBase, Coinbase: cfg.CoinBase,
GasLimit: ethermint.BlockGasLimit(ctx), GasLimit: laconicd.BlockGasLimit(ctx),
BlockNumber: big.NewInt(ctx.BlockHeight()), BlockNumber: big.NewInt(ctx.BlockHeight()),
Time: big.NewInt(ctx.BlockHeader().Time.Unix()), Time: big.NewInt(ctx.BlockHeader().Time.Unix()),
Difficulty: big.NewInt(0), // unused. Only required in PoW context Difficulty: big.NewInt(0), // unused. Only required in PoW context
@ -126,7 +126,7 @@ func (k Keeper) VMConfig(ctx sdk.Context, msg core.Message, cfg *types.EVMConfig
// 3. The requested height is from a height greater than the latest one // 3. The requested height is from a height greater than the latest one
func (k Keeper) GetHashFn(ctx sdk.Context) vm.GetHashFunc { func (k Keeper) GetHashFn(ctx sdk.Context) vm.GetHashFunc {
return func(height uint64) common.Hash { return func(height uint64) common.Hash {
h, err := ethermint.SafeInt64(height) h, err := laconicd.SafeInt64(height)
if err != nil { if err != nil {
k.Logger(ctx).Error("failed to cast height to int64", "error", err) k.Logger(ctx).Error("failed to cast height to int64", "error", err)
return common.Hash{} return common.Hash{}

View File

@ -6,7 +6,7 @@ import (
sdkmath "cosmossdk.io/math" sdkmath "cosmossdk.io/math"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
"github.com/cerc-io/laconicd/x/evm/statedb" "github.com/cerc-io/laconicd/x/evm/statedb"
"github.com/cerc-io/laconicd/x/evm/types" "github.com/cerc-io/laconicd/x/evm/types"
"github.com/cosmos/cosmos-sdk/store/prefix" "github.com/cosmos/cosmos-sdk/store/prefix"
@ -117,7 +117,7 @@ func (k *Keeper) SetAccount(ctx sdk.Context, addr common.Address, account stated
codeHash := common.BytesToHash(account.CodeHash) codeHash := common.BytesToHash(account.CodeHash)
if ethAcct, ok := acct.(ethermint.EthAccountI); ok { if ethAcct, ok := acct.(laconicd.EthAccountI); ok {
if err := ethAcct.SetCodeHash(codeHash); err != nil { if err := ethAcct.SetCodeHash(codeHash); err != nil {
return err return err
} }
@ -187,7 +187,7 @@ func (k *Keeper) DeleteAccount(ctx sdk.Context, addr common.Address) error {
} }
// NOTE: only Ethereum accounts (contracts) can be selfdestructed // NOTE: only Ethereum accounts (contracts) can be selfdestructed
_, ok := acct.(ethermint.EthAccountI) _, ok := acct.(laconicd.EthAccountI)
if !ok { if !ok {
return sdkerrors.Wrapf(types.ErrInvalidAccount, "type %T, address %s", acct, addr) return sdkerrors.Wrapf(types.ErrInvalidAccount, "type %T, address %s", acct, addr)
} }

View File

@ -3,12 +3,12 @@ package types
import ( import (
"fmt" "fmt"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
// Validate performs a basic validation of a GenesisAccount fields. // Validate performs a basic validation of a GenesisAccount fields.
func (ga GenesisAccount) Validate() error { func (ga GenesisAccount) Validate() error {
if err := ethermint.ValidateAddress(ga.Address); err != nil { if err := laconicd.ValidateAddress(ga.Address); err != nil {
return err return err
} }
return ga.Storage.Validate() return ga.Storage.Validate()

View File

@ -7,7 +7,7 @@ import (
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types" ethtypes "github.com/ethereum/go-ethereum/core/types"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
) )
// NewTransactionLogs creates a new NewTransactionLogs instance. // NewTransactionLogs creates a new NewTransactionLogs instance.
@ -28,7 +28,7 @@ func NewTransactionLogsFromEth(hash common.Hash, ethlogs []*ethtypes.Log) Transa
// Validate performs a basic validation of a GenesisAccount fields. // Validate performs a basic validation of a GenesisAccount fields.
func (tx TransactionLogs) Validate() error { func (tx TransactionLogs) Validate() error {
if ethermint.IsEmptyHash(tx.Hash) { if laconicd.IsEmptyHash(tx.Hash) {
return fmt.Errorf("hash cannot be the empty %s", tx.Hash) return fmt.Errorf("hash cannot be the empty %s", tx.Hash)
} }
@ -53,16 +53,16 @@ func (tx TransactionLogs) EthLogs() []*ethtypes.Log {
// Validate performs a basic validation of an ethereum Log fields. // Validate performs a basic validation of an ethereum Log fields.
func (log *Log) Validate() error { func (log *Log) Validate() error {
if err := ethermint.ValidateAddress(log.Address); err != nil { if err := laconicd.ValidateAddress(log.Address); err != nil {
return fmt.Errorf("invalid log address %w", err) return fmt.Errorf("invalid log address %w", err)
} }
if ethermint.IsEmptyHash(log.BlockHash) { if laconicd.IsEmptyHash(log.BlockHash) {
return fmt.Errorf("block hash cannot be the empty %s", log.BlockHash) return fmt.Errorf("block hash cannot be the empty %s", log.BlockHash)
} }
if log.BlockNumber == 0 { if log.BlockNumber == 0 {
return errors.New("block number cannot be zero") return errors.New("block number cannot be zero")
} }
if ethermint.IsEmptyHash(log.TxHash) { if laconicd.IsEmptyHash(log.TxHash) {
return fmt.Errorf("tx hash cannot be the empty %s", log.TxHash) return fmt.Errorf("tx hash cannot be the empty %s", log.TxHash)
} }
return nil return nil

View File

@ -483,7 +483,7 @@ func setupChain(localMinGasPricesStr string) {
// Initialize the app, so we can use SetMinGasPrices to set the // Initialize the app, so we can use SetMinGasPrices to set the
// validator-specific min-gas-prices setting // validator-specific min-gas-prices setting
db := dbm.NewMemDB() db := dbm.NewMemDB()
newapp := app.NewEthermintApp( newapp := app.NewLaconicApp(
log.NewNopLogger(), log.NewNopLogger(),
db, db,
nil, nil,
@ -505,7 +505,7 @@ func setupChain(localMinGasPricesStr string) {
// Initialize the chain // Initialize the chain
newapp.InitChain( newapp.InitChain(
abci.RequestInitChain{ abci.RequestInitChain{
ChainId: "ethermint_9000-1", ChainId: "laconic_9000-1",
Validators: []abci.ValidatorUpdate{}, Validators: []abci.ValidatorUpdate{},
AppStateBytes: stateBytes, AppStateBytes: stateBytes,
ConsensusParams: app.DefaultConsensusParams, ConsensusParams: app.DefaultConsensusParams,

View File

@ -25,7 +25,7 @@ import (
"github.com/cerc-io/laconicd/crypto/ethsecp256k1" "github.com/cerc-io/laconicd/crypto/ethsecp256k1"
"github.com/cerc-io/laconicd/encoding" "github.com/cerc-io/laconicd/encoding"
"github.com/cerc-io/laconicd/tests" "github.com/cerc-io/laconicd/tests"
ethermint "github.com/cerc-io/laconicd/types" laconicd "github.com/cerc-io/laconicd/types"
evmtypes "github.com/cerc-io/laconicd/x/evm/types" evmtypes "github.com/cerc-io/laconicd/x/evm/types"
"github.com/cerc-io/laconicd/x/feemarket/types" "github.com/cerc-io/laconicd/x/feemarket/types"
@ -44,7 +44,7 @@ type KeeperTestSuite struct {
suite.Suite suite.Suite
ctx sdk.Context ctx sdk.Context
app *app.EthermintApp app *app.LaconicApp
queryClient types.QueryClient queryClient types.QueryClient
address common.Address address common.Address
consAddress sdk.ConsAddress consAddress sdk.ConsAddress
@ -91,7 +91,7 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool) {
suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{ suite.ctx = suite.app.BaseApp.NewContext(checkTx, tmproto.Header{
Height: 1, Height: 1,
ChainID: "ethermint_9000-1", ChainID: "laconic_9000-1",
Time: time.Now().UTC(), Time: time.Now().UTC(),
ProposerAddress: suite.consAddress.Bytes(), ProposerAddress: suite.consAddress.Bytes(),
Version: tmversion.Consensus{ Version: tmversion.Consensus{
@ -117,7 +117,7 @@ func (suite *KeeperTestSuite) SetupApp(checkTx bool) {
types.RegisterQueryServer(queryHelper, suite.app.FeeMarketKeeper) types.RegisterQueryServer(queryHelper, suite.app.FeeMarketKeeper)
suite.queryClient = types.NewQueryClient(queryHelper) suite.queryClient = types.NewQueryClient(queryHelper)
acc := &ethermint.EthAccount{ acc := &laconicd.EthAccount{
BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(suite.address.Bytes()), nil, 0, 0), BaseAccount: authtypes.NewBaseAccount(sdk.AccAddress(suite.address.Bytes()), nil, 0, 0),
CodeHash: common.BytesToHash(crypto.Keccak256(nil)).String(), CodeHash: common.BytesToHash(crypto.Keccak256(nil)).String(),
} }

View File

@ -9,9 +9,9 @@ $ make build
```bash ```bash
./build/laconicd keys add root ./build/laconicd keys add root
./build/laconicd init test-moniker --chain-id ethermint_9000-1 ./build/laconicd init test-moniker --chain-id laconic_9000-1
./build/laconicd add-genesis-account $(./build/laconicd keys show root -a) 1000000000000000000aphoton,1000000000000000000stake ./build/laconicd add-genesis-account $(./build/laconicd keys show root -a) 1000000000000000000aphoton,1000000000000000000stake
./build/laconicd gentx root 1000000000000000000stake --chain-id ethermint_9000-1 ./build/laconicd gentx root 1000000000000000000stake --chain-id laconic_9000-1
./build/laconicd collect-gentxs ./build/laconicd collect-gentxs
./build/laconicd start ./build/laconicd start
``` ```
@ -58,7 +58,7 @@ $ ./build/laconicd q registry params -o json | jq .
> First you have to Create bond > First you have to Create bond
```bash ```bash
$ ./build/laconicd tx registry set ~/Desktop/examples/records/service_provider_example.yml 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d --from root --chain-id ethermint_9000-1 --yes -o json $ ./build/laconicd tx registry set ~/Desktop/examples/records/service_provider_example.yml 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d --from root --chain-id laconic_9000-1 --yes -o json
{ {
"height": "0", "height": "0",
"txhash": "BA44ABE1194724694E7CB290F9F3121DB4E63E1A030D95CB84813EEA132CF95F", "txhash": "BA44ABE1194724694E7CB290F9F3121DB4E63E1A030D95CB84813EEA132CF95F",
@ -121,7 +121,7 @@ $ ./build/laconicd q registry get bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my
## Reserve name ## Reserve name
```bash ```bash
./build/laconicd tx registry reserve-name hello --from root --chain-id ethermint_9000-1 --owner $(./build/laconicd key ./build/laconicd tx registry reserve-name hello --from root --chain-id laconic_9000-1 --owner $(./build/laconicd key
s show root -a) -y -o json | jq . s show root -a) -y -o json | jq .
{ {
"height": "0", "height": "0",
@ -181,8 +181,8 @@ $ ./build/laconicd q registry balance -o json | jq .
## add bond to the authority ## add bond to the authority
```bash ```bash
$ ./build/laconicd tx registry authority-bond [Authority Name] [Bond ID ] --from root --chain-id ethermint_9000-1 -y -o json | jq . $ ./build/laconicd tx registry authority-bond [Authority Name] [Bond ID ] --from root --chain-id laconic_9000-1 -y -o json | jq .
$ ./build/laconicd tx registry authority-bond hello 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d --from root --chain-id ethermint_9000-1 -y -o json | jq . $ ./build/laconicd tx registry authority-bond hello 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d --from root --chain-id laconic_9000-1 -y -o json | jq .
``` ```
## Query the records by associate bond id ## Query the records by associate bond id
@ -209,7 +209,7 @@ $ ./build/laconicd q registry query-by-bond 95f68b1b862bfd1609b0c9aaf7300287b92f
## dissociate bond from record ## dissociate bond from record
```bash ```bash
$ ./build/laconicd tx registry dissociate-bond bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae --from root --chain-id ethermint_9000-1 $ ./build/laconicd tx registry dissociate-bond bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae --from root --chain-id laconic_9000-1
{"body":{"messages":[{"@type":"/vulcanize.registry.v1beta1.MsgDissociateBond","record_id":"bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae","signer":"ethm1mfdjngh5jvjs9lqtt9a7y2hlgw8v3syh3hsqzk"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]} {"body":{"messages":[{"@type":"/vulcanize.registry.v1beta1.MsgDissociateBond","record_id":"bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae","signer":"ethm1mfdjngh5jvjs9lqtt9a7y2hlgw8v3syh3hsqzk"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]}
confirm transaction before signing and broadcasting [y/N]: y confirm transaction before signing and broadcasting [y/N]: y
@ -231,7 +231,7 @@ txhash: 7AFEF524CB0D92D6576FC08601A787786E802449888FD8DDAA7635698CC85060
## Associate bond with record ## Associate bond with record
```bash ```bash
./build/laconicd tx registry associate-bond bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id ethermint_9000-1 -y -o json | jq . ./build/laconicd tx registry associate-bond bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id laconic_9000-1 -y -o json | jq .
{ {
"height": "0", "height": "0",
"txhash": "F75C2BF2FE73668AE1332E1237F924AC549E31E822A56394DE5AC17200B199F9", "txhash": "F75C2BF2FE73668AE1332E1237F924AC549E31E822A56394DE5AC17200B199F9",
@ -252,7 +252,7 @@ txhash: 7AFEF524CB0D92D6576FC08601A787786E802449888FD8DDAA7635698CC85060
## dissociate-records => remove all record from bond ## dissociate-records => remove all record from bond
```bash ```bash
$./build/laconicd tx registry dissociate-records c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id ethermint_9000-1 -y -o json | jq . $./build/laconicd tx registry dissociate-records c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id laconic_9000-1 -y -o json | jq .
{ {
"height": "0", "height": "0",
"txhash": "0316F503E5DEA47CB108AE6C7C7FFAF3F71CC56BC22F63CB97322E1BE48B33B9", "txhash": "0316F503E5DEA47CB108AE6C7C7FFAF3F71CC56BC22F63CB97322E1BE48B33B9",
@ -274,14 +274,14 @@ $./build/laconicd tx registry dissociate-records c3f7a78c5042d2003880962ba31ff3b
> When a record is expires , needs to renew record > When a record is expires , needs to renew record
```bash ```bash
$ ./build/laconicd tx registry renew-record bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae --from root --chain-id ethermint_9000-1 $ ./build/laconicd tx registry renew-record bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae --from root --chain-id laconic_9000-1
``` ```
## Set the authority name ## Set the authority name
```bash ```bash
$ ./build/laconicd tx registry set-name crn://hello/test test_hello_cid --from root --chain-id ethermint_9000-1 -y -o json | jq . $ ./build/laconicd tx registry set-name crn://hello/test test_hello_cid --from root --chain-id laconic_9000-1 -y -o json | jq .
{ {
"height": "0", "height": "0",
"txhash": "66A63C73B076EEE9A2F7605354448EDEB161F0115D4D03AF68C01BA28DB97486", "txhash": "66A63C73B076EEE9A2F7605354448EDEB161F0115D4D03AF68C01BA28DB97486",
@ -301,7 +301,7 @@ $ ./build/laconicd tx registry set-name crn://hello/test test_hello_cid --from
## Delete the name ## Delete the name
```bash ```bash
$./build/laconicd tx registry delete-name crn://hello/test --from root --chain-id ethermint_9000-1 -y $./build/laconicd tx registry delete-name crn://hello/test --from root --chain-id laconic_9000-1 -y
code: 0 code: 0
codespace: "" codespace: ""
data: "" data: ""

View File

@ -21,7 +21,7 @@ var seed = int64(233)
type KeeperTestSuite struct { type KeeperTestSuite struct {
suite.Suite suite.Suite
app *app.EthermintApp app *app.LaconicApp
ctx sdk.Context ctx sdk.Context
queryClient types.QueryClient queryClient types.QueryClient
accounts []sdk.AccAddress accounts []sdk.AccAddress
@ -29,7 +29,7 @@ type KeeperTestSuite struct {
} }
func (suite *KeeperTestSuite) SetupTest() { func (suite *KeeperTestSuite) SetupTest() {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState { testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis return genesis
}) })
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{}) ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})
@ -58,7 +58,7 @@ func (suite *KeeperTestSuite) SetupTest() {
} }
func TestParams(t *testing.T) { func TestParams(t *testing.T) {
testApp := app.Setup(false, func(ea *app.EthermintApp, genesis simapp.GenesisState) simapp.GenesisState { testApp := app.Setup(false, func(ea *app.LaconicApp, genesis simapp.GenesisState) simapp.GenesisState {
return genesis return genesis
}) })
ctx := testApp.BaseApp.NewContext(false, tmproto.Header{}) ctx := testApp.BaseApp.NewContext(false, tmproto.Header{})