Skip to content

Commit

Permalink
fix: use adym as denom (#740)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemijspavlovs committed Feb 12, 2024
1 parent 26fe1a6 commit b4977ec
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 44 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
HUB_SEQ_ADDR=$(go run . keys list --home $ROLLER_CONFIG_PATH --output json | jq -r '.hub_sequencer')
echo "HUB_SEQ_ADDR=$HUB_SEQ_ADDR" >> $GITHUB_ENV
RELAYER_ROLLAPP_ADDR=$(go run . keys list --home $ROLLER_CONFIG_PATH --output json | jq -r '."relayer-hub-key"')
/usr/local/bin/dymd tx bank multi-send local-user $HUB_SEQ_ADDR $RELAYER_ROLLAPP_ADDR 1udym --yes -b block --keyring-backend test --home $ROLLER_CONFIG_PATH/local-hub --node http://127.0.0.1:36657
/usr/local/bin/dymd tx bank multi-send local-user $HUB_SEQ_ADDR $RELAYER_ROLLAPP_ADDR 1adym --yes -b block --keyring-backend test --home $ROLLER_CONFIG_PATH/local-hub --node http://127.0.0.1:36657
sleep 10
- name: Register the rollapp
Expand Down
2 changes: 1 addition & 1 deletion cmd/config/init/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func GetInitConfig(initCmd *cobra.Command, args []string) (*config.RollappConfig
cfg.RollappID = args[0]
}
if len(args) > 1 {
cfg.Denom = "u" + args[1]
cfg.Denom = "a" + args[1]
}

if interactive {
Expand Down
4 changes: 2 additions & 2 deletions cmd/config/init/interactive.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func RunInteractiveMode(cfg *config.RollappConfig) error {

promptDenom := promptui.Prompt{
Label: "Specify your RollApp denom",
Default: strings.TrimPrefix(cfg.Denom, "u"),
Default: strings.TrimPrefix(cfg.Denom, "a"),
AllowEdit: true,
Validate: func(s string) error {
if !config.IsValidTokenSymbol(s) {
Expand All @@ -107,7 +107,7 @@ func RunInteractiveMode(cfg *config.RollappConfig) error {
if err != nil {
return err
}
cfg.Denom = "u" + denom
cfg.Denom = "a" + denom

promptTokenSupply := promptui.Prompt{
Label: "How many " + denom + " tokens do you wish to mint for Genesis?",
Expand Down
2 changes: 1 addition & 1 deletion cmd/consts/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var Denoms = struct {
Celestia string
Avail string
}{
Hub: "udym",
Hub: "adym",
Celestia: "utia",
Avail: "aAVL",
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/tx/register/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

// TODO: Test registration on 35-C and update the price
var registerUdymPrice = big.NewInt(1)
var registerAdymPrice = big.NewInt(1)

var flagNames = struct {
NoOutput string
Expand Down Expand Up @@ -53,7 +53,7 @@ func register(cmd *cobra.Command, args []string) error {
if err != nil {
return err
}
notFundedAddrs, err := utils.GetSequencerInsufficientAddrs(rollappConfig, registerUdymPrice)
notFundedAddrs, err := utils.GetSequencerInsufficientAddrs(rollappConfig, registerAdymPrice)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ func ValidateDecimals(decimals uint) error {
}

func IsValidDenom(s string) error {
if !strings.HasPrefix(s, "u") {
return fmt.Errorf("invalid denom '%s'. denom expected to start with 'u'", s)
if !strings.HasPrefix(s, "a") {
return fmt.Errorf("invalid denom '%s'. denom expected to start with 'a'", s)
}
if !IsValidTokenSymbol(s[1:]) {
return fmt.Errorf("invalid token symbol '%s'", s[1:])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ chains:
- ethermint
feegrants: null
gas-adjustment: 1.2
gas-prices: 0udym
gas-prices: 0adym
key: relayer-rollapp-key
key-directory: PLACEHOLDER_KEY_DIRECTORY
keyring-backend: test
Expand All @@ -39,7 +39,7 @@ chains:
- ethermint
feegrants: null
gas-adjustment: 1.2
gas-prices: 100000000udym
gas-prices: 100000000adym
key: relayer-hub-key
key-directory: PLACEHOLDER_KEY_DIRECTORY
keyring-backend: test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ iavl-lazy-loading = false
index-events = []
inter-block-cache = true
min-retain-blocks = 0
minimum-gas-prices = "0udym"
minimum-gas-prices = "0adym"
pruning = "custom"
pruning-interval = "18000"
pruning-keep-recent = "6048000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dym_account_name = "hub_sequencer"
empty_blocks_max_time = "3600s"
gas_fees = ""
gas_limit = 0
gas_prices = "0udym"
gas_prices = "0adym"
keyring_backend = "test"
keyring_home_dir = "PLACEHOLDER_KEYRING_HOME_DIR"
namespace_id = "PLACEHOLDER_NAMESPACE_ID"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"address": "PLACEHOLDER_SEQUENCER_ADDRESS",
"coins": [
{
"denom": "udym",
"denom": "adym",
"amount": "PLACEHOLDER_SEQUENCER_BALANCE"
}
]
Expand All @@ -72,19 +72,19 @@
"address": "PLACEHOLDER_RELAYER_ADDRESS",
"coins": [
{
"denom": "udym",
"denom": "adym",
"amount": "PLACEHOLDER_RELAYER_BALANCE"
}
]
}
],
"supply": [
{
"denom": "udym",
"denom": "adym",
"amount": "1000000000000000000000"
}
],
"denom_metadata": [{"base":"udym","denom_units":[{"aliases":[],"denom":"udym","exponent":0},{"aliases":[],"denom":"dym","exponent":18}],"description":"Denom metadata for dym (udym)","display":"dym","name":"dym","symbol":"DYM"}]
"denom_metadata": [{"base":"adym","denom_units":[{"aliases":[],"denom":"adym","exponent":0},{"aliases":[],"denom":"dym","exponent":18}],"description":"Denom metadata for dym (adym)","display":"dym","name":"dym","symbol":"DYM"}]
},
"capability": {
"index": "1",
Expand Down Expand Up @@ -176,7 +176,7 @@
"evm": {
"accounts": [],
"params": {
"evm_denom": "udym",
"evm_denom": "adym",
"enable_create": true,
"enable_call": true,
"extra_eips": [],
Expand Down Expand Up @@ -243,7 +243,7 @@
"key": "PLACEHOLDER_SEQUENCER_PUBKEY"
},
"value": {
"denom": "udym",
"denom": "adym",
"amount": "500000000000000000000"
}
}
Expand Down Expand Up @@ -290,7 +290,7 @@
"deposit_params": {
"min_deposit": [
{
"denom": "udym",
"denom": "adym",
"amount": "10000000"
}
],
Expand Down Expand Up @@ -344,7 +344,7 @@
"epoch_provisions": "0.000000000000000000"
},
"params": {
"mint_denom": "udym",
"mint_denom": "adym",
"genesis_epoch_provisions": "285388127.853881278538812785",
"epoch_identifier": "mint",
"reduction_period_in_epochs": "8760",
Expand Down Expand Up @@ -399,7 +399,7 @@
"max_validators": 100,
"max_entries": 7,
"historical_entries": 10000,
"bond_denom": "udym",
"bond_denom": "adym",
"min_commission_rate": "0.050000000000000000"
},
"last_total_power": "0",
Expand All @@ -420,5 +420,5 @@
},
"upgrade": {},
"vesting": {}
,"crisis":{"constant_fee":{"denom":"udym"}}}
,"crisis":{"constant_fee":{"denom":"adym"}}}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"hub_sequencer","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"ethm1fhnj5f0ghtlju5cd8zrdrky7cn7rfjh4d4mwsw","validator_address":"ethmvaloper1fhnj5f0ghtlju5cd8zrdrky7cn7rfjh4z93zgn","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"0/ApLj1BjXdNQS2Uy3phsKs9U/N0+2CZDCDJhSwbJ6M="},"value":{"denom":"udym","amount":"500000000000000000000"}}],"memo":"12efb22549939e77485f2189c550f9d5810ac896@192.168.1.12:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"Audm6qmAO/cyHKgKjvLWWe/rfVYICii/pVOePKSdcG3h"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["PVm+sMhJWsYZ3aIjMbKkiehX15kmsUbMLM4vVN9MFsVNV3smgm4BH/jc+zpd+Fbc/zwPuR0Aw1m2/L9+pOjPqwA="]}
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"hub_sequencer","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"ethm1fhnj5f0ghtlju5cd8zrdrky7cn7rfjh4d4mwsw","validator_address":"ethmvaloper1fhnj5f0ghtlju5cd8zrdrky7cn7rfjh4z93zgn","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"0/ApLj1BjXdNQS2Uy3phsKs9U/N0+2CZDCDJhSwbJ6M="},"value":{"denom":"adym","amount":"500000000000000000000"}}],"memo":"12efb22549939e77485f2189c550f9d5810ac896@192.168.1.12:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"Audm6qmAO/cyHKgKjvLWWe/rfVYICii/pVOePKSdcG3h"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["PVm+sMhJWsYZ3aIjMbKkiehX15kmsUbMLM4vVN9MFsVNV3smgm4BH/jc+zpd+Fbc/zwPuR0Aw1m2/L9+pOjPqwA="]}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ chains:
- ethermint
feegrants: null
gas-adjustment: 1.2
gas-prices: 0udym
gas-prices: 0adym
key: relayer-rollapp-key
key-directory: PLACEHOLDER_KEY_DIRECTORY
keyring-backend: test
Expand All @@ -39,7 +39,7 @@ chains:
- ethermint
feegrants: null
gas-adjustment: 1.2
gas-prices: 100000000udym
gas-prices: 100000000adym
key: relayer-hub-key
key-directory: PLACEHOLDER_KEY_DIRECTORY
keyring-backend: test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ iavl-lazy-loading = false
index-events = []
inter-block-cache = true
min-retain-blocks = 0
minimum-gas-prices = "0udym"
minimum-gas-prices = "0adym"
pruning = "custom"
pruning-interval = "18000"
pruning-keep-recent = "6048000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
###############################################################################

# The network chain ID
chain-id = "PLACEHOLDER_ROLLAPP_ID"
chain-id = "PLACEHOLDER_ROLLAPP_UD"
# The keyring's backend, where the keys are stored (os|file|kwallet|pass|test|memory)
keyring-backend = "os"
# CLI output format (text|json)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dym_account_name = "hub_sequencer"
empty_blocks_max_time = "3600s"
gas_fees = ""
gas_limit = 0
gas_prices = "0udym"
gas_prices = "0adym"
keyring_backend = "test"
keyring_home_dir = "PLACEHOLDER_KEYRING_HOME_DIR"
namespace_id = "PLACEHOLDER_NAMESPACE_ID"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"address": "PLACEHOLDER_SEQUENCER_ADDRESS",
"coins": [
{
"denom": "udym",
"denom": "adym",
"amount": "PLACEHOLDER_SEQUENCER_BALANCE"
}
]
Expand All @@ -72,19 +72,19 @@
"address": "PLACEHOLDER_RELAYER_ADDRESS",
"coins": [
{
"denom": "udym",
"denom": "adym",
"amount": "PLACEHOLDER_RELAYER_BALANCE"
}
]
}
],
"supply": [
{
"denom": "udym",
"denom": "adym",
"amount": "1000000000000000000000000000"
}
],
"denom_metadata": [{"base":"udym","denom_units":[{"aliases":[],"denom":"udym","exponent":0},{"aliases":[],"denom":"dym","exponent":18}],"description":"Denom metadata for dym (udym)","display":"dym","name":"dym","symbol":"DYM"}]
"denom_metadata": [{"base":"adym","denom_units":[{"aliases":[],"denom":"adym","exponent":0},{"aliases":[],"denom":"dym","exponent":18}],"description":"Denom metadata for dym (adym)","display":"dym","name":"dym","symbol":"DYM"}]
},
"capability": {
"index": "1",
Expand Down Expand Up @@ -176,7 +176,7 @@
"evm": {
"accounts": [],
"params": {
"evm_denom": "udym",
"evm_denom": "adym",
"enable_create": true,
"enable_call": true,
"extra_eips": [],
Expand Down Expand Up @@ -243,7 +243,7 @@
"key": "PLACEHOLDER_SEQUENCER_PUBKEY"
},
"value": {
"denom": "udym",
"denom": "adym",
"amount": "500000000000000000000000000"
}
}
Expand Down Expand Up @@ -290,7 +290,7 @@
"deposit_params": {
"min_deposit": [
{
"denom": "udym",
"denom": "adym",
"amount": "10000000"
}
],
Expand Down Expand Up @@ -344,7 +344,7 @@
"epoch_provisions": "0.000000000000000000"
},
"params": {
"mint_denom": "udym",
"mint_denom": "adym",
"genesis_epoch_provisions": "285388127.853881278538812785",
"epoch_identifier": "mint",
"reduction_period_in_epochs": "8760",
Expand Down Expand Up @@ -399,7 +399,7 @@
"max_validators": 100,
"max_entries": 7,
"historical_entries": 10000,
"bond_denom": "udym",
"bond_denom": "adym",
"min_commission_rate": "0.050000000000000000"
},
"last_total_power": "0",
Expand All @@ -420,5 +420,5 @@
},
"upgrade": {},
"vesting": {}
,"crisis":{"constant_fee":{"denom":"udym"}}}
,"crisis":{"constant_fee":{"denom":"adym"}}}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"hub_sequencer","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"ethm1lg494fsvlznfqnmjp3ux7h52rh59j3l7l7y3jg","validator_address":"ethmvaloper1lg494fsvlznfqnmjp3ux7h52rh59j3l7swwa24","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"aeGRXQyp2n14AGAMMRvfx5pSn433gzAYDP3fUhe7PVc="},"value":{"denom":"udym","amount":"500000000000000000000000000"}}],"memo":"176f55795af8f10e491db67a5256457817c7c5e1@192.168.1.12:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"AoyjSOcURvhaysJi7KEOswMtJrUUmEGFa9mNbeC2gwJd"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["1Lk6euTnb/w1bTZ63NKWAhC61RCNCKA7k3BdFHs6d0pjcVcnfqQHqGA/7KKyxJHtdqQtqIoa4vBMjbbPQojX6wE="]}
{"body":{"messages":[{"@type":"/cosmos.staking.v1beta1.MsgCreateValidator","description":{"moniker":"hub_sequencer","identity":"","website":"","security_contact":"","details":""},"commission":{"rate":"0.100000000000000000","max_rate":"0.200000000000000000","max_change_rate":"0.010000000000000000"},"min_self_delegation":"1","delegator_address":"ethm1lg494fsvlznfqnmjp3ux7h52rh59j3l7l7y3jg","validator_address":"ethmvaloper1lg494fsvlznfqnmjp3ux7h52rh59j3l7swwa24","pubkey":{"@type":"/cosmos.crypto.ed25519.PubKey","key":"aeGRXQyp2n14AGAMMRvfx5pSn433gzAYDP3fUhe7PVc="},"value":{"denom":"adym","amount":"500000000000000000000000000"}}],"memo":"176f55795af8f10e491db67a5256457817c7c5e1@192.168.1.12:26656","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[{"public_key":{"@type":"/ethermint.crypto.v1.ethsecp256k1.PubKey","key":"AoyjSOcURvhaysJi7KEOswMtJrUUmEGFa9mNbeC2gwJd"},"mode_info":{"single":{"mode":"SIGN_MODE_DIRECT"}},"sequence":"0"}],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":["1Lk6euTnb/w1bTZ63NKWAhC61RCNCKA7k3BdFHs6d0pjcVcnfqQHqGA/7KKyxJHtdqQtqIoa4vBMjbbPQojX6wE="]}
10 changes: 6 additions & 4 deletions test/config/init/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ package initconfig_test

import (
"fmt"
"github.com/dymensionxyz/roller/config"
"os"
"path/filepath"
"testing"

"os"
"github.com/stretchr/testify/assert"

initconfig "github.com/dymensionxyz/roller/cmd/config/init"
"github.com/dymensionxyz/roller/cmd/utils"
"github.com/dymensionxyz/roller/config"
"github.com/dymensionxyz/roller/test/config/init/testutils"
"github.com/stretchr/testify/assert"
)

func TestInitCmd(t *testing.T) {
Expand Down Expand Up @@ -65,7 +65,9 @@ func TestInitCmd(t *testing.T) {
assert.NoError(err)
assert.NoError(os.Remove(filepath.Join(tempDir, config.RollerConfigFileName)))
assert.NoError(testutils.VerifyRollappKeys(tempDir))
assert.NoError(testutils.VerifyRelayerKeys(tempDir, rlpCfg.RollappID, rlpCfg.HubData.ID))
assert.NoError(
testutils.VerifyRelayerKeys(tempDir, rlpCfg.RollappID, rlpCfg.HubData.ID),
)
assert.NoError(testutils.VerifyCelestiaLightNodeKeys(tempDir))
assert.NoError(testutils.SanitizeConfigDir(tempDir, &rlpCfg))
assert.NoError(testutils.VerifyRlyConfig(rlpCfg, tc.goldenDirPath))
Expand Down

0 comments on commit b4977ec

Please sign in to comment.