Skip to content

Commit

Permalink
Merge branch 'main' into feature/x-act-v2/vote-handler
Browse files Browse the repository at this point in the history
  • Loading branch information
artur-abliazimov authored Sep 5, 2024
2 parents 2a83ffd + c992b59 commit b29f31a
Show file tree
Hide file tree
Showing 13 changed files with 244 additions and 253 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* (x/warden) [#660](https://github.com/warden-protocol/wardenprotocol/660) Added `Nonce` field to Space to avoid race conditions
* (x/warden) Keychain fees are deducted with escrow account
* (wardend) Bump Cosmos SDK to v0.50.9
* (wardend) Bump ibc-go to v8.4.0
* (wardend) Bump ibc-go to v8.5.0
* (wardend) Bump slinky to v1.0.10
* (x/warden) [#570](https://github.com/warden-protocol/wardenprotocol/570) Added more metadata to Keychain
* Replaced Description by Name field (required, non-empty)
Expand All @@ -60,11 +60,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* (x/act) Add support for sdk.Coins fields in autogenerated CLI commands for new actions
* (x/warden) Add the ability for the user to specify the maximum keychain fee size to be deducted
* (x/warden) Return error if analyzer's address is not bench32
* (evm) Resolve dependencies issues. For go-ethereum use [evmos fork](https://github.com/evmos/go-ethereum/releases/tag/v1.10.26-evmos-rc2) patched with [c1b68f1d05a7ee8eee1bde3c4054f49f5d3e3b9f](https://github.com/ethereum/go-ethereum/pull/24911) from original repository to support slinky.
* (evm) To adopt ethsecp256k1 use fork of evmos's cosmos-sdk. Fork patched runtime/module adding into ProvideApp two arguments to customize registering interface registry and legacy amino codec.
* (evm) Introduce award denomination to adjust units with Ethereum
* (evm) Using ethsecp256k1 signature for all transactions. Users should reimport their seeds to get new addresses.
* (x/warden) Return error if analyzer's address is not bech32
* (wardend) Validate bech32 format in add-genesis-keychain and add-genesis-space

### Bug Fixes
* (x/gmp) Remove the GMP default params from genesis
Expand Down
19 changes: 10 additions & 9 deletions cmd/faucet/faucet.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ type Faucet struct {
}

const (
mutexLocked = 1
workers = 2
uwardConversion = 1000000
dailyHours = 24
mutexLocked = 1
workers = 2
dailyHours = 24
)

func execute(cmdString string) (Out, error) {
Expand Down Expand Up @@ -150,8 +149,8 @@ func InitFaucet(logger zerolog.Logger) (Faucet, error) {
Mutex: &sync.Mutex{},
Batch: []string{},
log: logger,
TokensAvailable: float64(cfg.DailyLimit) / uwardConversion,
DailySupply: float64(cfg.DailyLimit) / uwardConversion,
TokensAvailable: float64(cfg.DailyLimit),
DailySupply: float64(cfg.DailyLimit),
Amount: float64(amount),
}

Expand Down Expand Up @@ -231,9 +230,10 @@ func (f *Faucet) Send(addr string, force bool) (string, int, error) {
send = "multi-send"
}

f.log.Info().Msgf("sending %s%s to %v", f.config.Amount, f.config.Denom, f.Batch)
f.log.Info().Msgf("sending %s WARD to %v", f.config.Amount, f.Batch)

amount := f.config.Amount + f.config.Denom
amount := f.config.Amount + strings.Repeat("0", f.config.Decimals) + f.config.Denom
f.log.Info().Msg(amount)

cmd := strings.Join([]string{
f.config.CliName,
Expand All @@ -255,6 +255,7 @@ func (f *Faucet) Send(addr string, force bool) (string, int, error) {
"-o",
"json",
}, " ")
f.log.Info().Msg(cmd)

out, err := execute(cmd)
if err != nil {
Expand All @@ -278,7 +279,7 @@ func (f *Faucet) Send(addr string, force bool) (string, int, error) {
)
}

f.TokensAvailable = (f.TokensAvailable - float64(len(f.Batch))*f.Amount/uwardConversion)
f.TokensAvailable = (f.TokensAvailable - float64(len(f.Batch))*f.Amount)
f.log.Info().Msgf("tokens available: %f", f.TokensAvailable)
dailySupply.Set(f.TokensAvailable)

Expand Down
9 changes: 5 additions & 4 deletions cmd/faucet/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ type Config struct {
ChainID string `env:"CHAIN_ID" envDefault:"buenavista-1" mapstructure:"CHAIN_ID"`
CliName string `env:"CLI_NAME" envDefault:"wardend" mapstructure:"CLI_NAME"`
AccountName string `env:"ACCOUNT_NAME" envDefault:"faucet" mapstructure:"ACCOUNT_NAME"`
Denom string `env:"DENOM" envDefault:"uward" mapstructure:"DENOM"`
Amount string `env:"AMOUNT" envDefault:"1000000" mapstructure:"AMOUNT"`
Fees string `env:"FEES" envDefault:"25uward" mapstructure:"FEES"`
Denom string `env:"DENOM" envDefault:"award" mapstructure:"DENOM"`
Amount string `env:"AMOUNT" envDefault:"1" mapstructure:"AMOUNT"`
Fees string `env:"FEES" envDefault:"25000000000000award" mapstructure:"FEES"`
KeyringBackend string `env:"KEYRING" envDefault:"test" mapstructure:"KEYRING"`
BatchInterval time.Duration `env:"BATCH_INTERVAL" envDefault:"5s" mapstructure:"BATCH_INTERVAL"`
DailyLimit int64 `env:"DAILY_LIMIT" envDefault:"100000000" mapstructure:"DAILY_LIMIT"`
DailyLimit int64 `env:"DAILY_LIMIT" envDefault:"100000" mapstructure:"DAILY_LIMIT"`
BatchLimit int `env:"BATCH_LIMIT" envDefault:"10" mapstructure:"BATCH_LIMIT"`
TXRetry int `env:"TX_RETRY" envDefault:"10" mapstructure:"TX_RETRY"`
Chain string `env:"CHAIN" envDefault:"Buenavista" mapstructure:"CHAIN"`
Decimals int `env:"DECIMALS" envDefault:"18" mapstructure:"DECIMALS"`
}

func LoadConfig() (Config, error) {
Expand Down
6 changes: 6 additions & 0 deletions cmd/wardend/cmd/gen-keychains.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"

sdk "github.com/cosmos/cosmos-sdk/types"
wardentypes "github.com/warden-protocol/wardenprotocol/warden/x/warden/types/v1beta3"
)

Expand All @@ -19,6 +20,11 @@ func AddGenesisKeychainCmd(defaultNodeHome string) *cobra.Command {
cdc, genesisFileURL := setupGenCommand(cmd)

creator := args[0]
_, err := sdk.AccAddressFromBech32(creator)
if err != nil {
return err
}

name := args[1]
keychainFeesJson := args[2]

Expand Down
5 changes: 5 additions & 0 deletions cmd/wardend/cmd/gen-spaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/spf13/cobra"

sdk "github.com/cosmos/cosmos-sdk/types"
wardentypes "github.com/warden-protocol/wardenprotocol/warden/x/warden/types/v1beta3"
)

Expand All @@ -19,6 +20,10 @@ func AddGenesisSpaceCmd(defaultNodeHome string) *cobra.Command {
cdc, genesisFileURL := setupGenCommand(cmd)

creator := args[0]
_, err := sdk.AccAddressFromBech32(creator)
if err != nil {
return err
}

return updateGenesisState(
genesisFileURL,
Expand Down
51 changes: 16 additions & 35 deletions docs/developer-docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 16 additions & 29 deletions docs/help-center/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b29f31a

Please sign in to comment.