From 628a7f56b882de14a5f3aff07e0efe14ba5e2977 Mon Sep 17 00:00:00 2001 From: Jake Hartnell Date: Wed, 19 Aug 2020 13:41:38 -0700 Subject: [PATCH] FUEL -> STB, closes #138 --- Makefile | 4 +- app/app.go | 2 +- contrib/ci/chains/stakebird.json | 4 +- contrib/ci/setup-stakebird.sh | 2 +- .../relayer/configs/stakebird-xfer/ibc1.json | 4 +- docker/entry-point.sh | 4 +- docker/test-entry-point.sh | 4 +- testdata/sim_app.go | 2 +- testdata/test_helpers.go | 4 +- x/curating/abci_test.go | 38 +++++++++---------- x/curating/keeper/post_test.go | 20 +++++----- x/curating/keeper/reward_pool_test.go | 2 +- x/curating/keeper/upvote_test.go | 16 ++++---- x/curating/quadratic_test.go | 4 +- x/curating/types/key.go | 2 +- x/funding/client/cli/tx.go | 4 +- x/funding/types/key.go | 2 +- 17 files changed, 59 insertions(+), 59 deletions(-) diff --git a/Makefile b/Makefile index 60756e723..eaefaa195 100644 --- a/Makefile +++ b/Makefile @@ -21,8 +21,8 @@ create-wallet: init: staked init stakebird --chain-id localnet-1 - staked add-genesis-account $(shell stakecli keys show validator -a) 10000000000000000ufuel --keyring-backend test - staked gentx --name=validator --amount 10000000000ufuel --keyring-backend test + staked add-genesis-account $(shell stakecli keys show validator -a) 10000000000000000ustb --keyring-backend test + staked gentx --name=validator --amount 10000000000ustb --keyring-backend test staked collect-gentxs install: go.sum diff --git a/app/app.go b/app/app.go index 19fdbbd32..22d44dc10 100644 --- a/app/app.go +++ b/app/app.go @@ -48,7 +48,7 @@ import ( const ( appName = "stake" // DefaultStakeDenom for Stakebird - DefaultStakeDenom = "ufuel" + DefaultStakeDenom = "ustb" // DefaultUnbondingPeriod for Stakebird DefaultUnbondingPeriod = "504h" diff --git a/contrib/ci/chains/stakebird.json b/contrib/ci/chains/stakebird.json index 5d7b8a2a8..803f48752 100644 --- a/contrib/ci/chains/stakebird.json +++ b/contrib/ci/chains/stakebird.json @@ -4,7 +4,7 @@ "rpc-addr": "http://stakebird:26657", "account-prefix": "stake", "gas": 200000, - "gas-prices": "0.025ufuel", - "default-denom": "ufuel", + "gas-prices": "0.025ustb", + "default-denom": "ustb", "trusting-period": "330h" } diff --git a/contrib/ci/setup-stakebird.sh b/contrib/ci/setup-stakebird.sh index 97dd65e93..433600c41 100755 --- a/contrib/ci/setup-stakebird.sh +++ b/contrib/ci/setup-stakebird.sh @@ -1,5 +1,5 @@ GAIA_TAG="goz-phase-3" -DENOM=ufuel +DENOM=ustb CHAINID=stakebird RLYKEY=stake10dmk2q0numq3v0s7vwsx20dm4hq040vsawpj35 make install diff --git a/contrib/ibc/relayer/configs/stakebird-xfer/ibc1.json b/contrib/ibc/relayer/configs/stakebird-xfer/ibc1.json index 52bf53c73..b27647ba9 100644 --- a/contrib/ibc/relayer/configs/stakebird-xfer/ibc1.json +++ b/contrib/ibc/relayer/configs/stakebird-xfer/ibc1.json @@ -4,7 +4,7 @@ "rpc-addr": "http://localhost:26557", "account-prefix": "stake", "gas": 200000, - "gas-prices": "0.025ufuel", - "default-denom": "ufuel", + "gas-prices": "0.025ustb", + "default-denom": "ustb", "trusting-period": "336h" } diff --git a/docker/entry-point.sh b/docker/entry-point.sh index d73e5c202..1f04bdb1f 100755 --- a/docker/entry-point.sh +++ b/docker/entry-point.sh @@ -14,12 +14,12 @@ if [ -z "$2" ]; then fi # Build genesis file incl account for passed address -coins="100000000000ufuel,100000000000nitro" +coins="100000000000ustb,100000000000nitro" staked init --chain-id $CHAINID $CHAINID stakecli keys add validator --keyring-backend="test" staked add-genesis-account validator $coins --keyring-backend="test" staked add-genesis-account $GENACCT $coins --keyring-backend="test" -staked gentx --name validator --amount 1000000ufuel --keyring-backend="test" +staked gentx --name validator --amount 1000000ustb --keyring-backend="test" staked collect-gentxs diff --git a/docker/test-entry-point.sh b/docker/test-entry-point.sh index d73e5c202..1f04bdb1f 100755 --- a/docker/test-entry-point.sh +++ b/docker/test-entry-point.sh @@ -14,12 +14,12 @@ if [ -z "$2" ]; then fi # Build genesis file incl account for passed address -coins="100000000000ufuel,100000000000nitro" +coins="100000000000ustb,100000000000nitro" staked init --chain-id $CHAINID $CHAINID stakecli keys add validator --keyring-backend="test" staked add-genesis-account validator $coins --keyring-backend="test" staked add-genesis-account $GENACCT $coins --keyring-backend="test" -staked gentx --name validator --amount 1000000ufuel --keyring-backend="test" +staked gentx --name validator --amount 1000000ustb --keyring-backend="test" staked collect-gentxs diff --git a/testdata/sim_app.go b/testdata/sim_app.go index 4a9dc77b8..2bd7b6403 100644 --- a/testdata/sim_app.go +++ b/testdata/sim_app.go @@ -47,7 +47,7 @@ import ( const ( appName = "SimApp" // DefaultStakeDenom for rocket hub - DefaultStakeDenom = "ufuel" + DefaultStakeDenom = "ustb" // Bech32MainPrefix defines the Bech32 prefix of an account's address Bech32MainPrefix = "stake" diff --git a/testdata/test_helpers.go b/testdata/test_helpers.go index 027e92cd8..7d7cfece4 100644 --- a/testdata/test_helpers.go +++ b/testdata/test_helpers.go @@ -83,9 +83,9 @@ func addTestAddrs(app *SimApp, ctx sdk.Context, accNum int, accAmt sdk.Int, stra testAddrs := strategy(accNum) stakeCoin := sdk.NewCoin("stake", accAmt) - fuelCoin := sdk.NewCoin("ufuel", accAmt) + stbCoin := sdk.NewCoin("ustb", accAmt) ibcCoin := sdk.NewCoin("transfer/ibczeroxfer/stake", accAmt) - initCoins := sdk.NewCoins(stakeCoin, fuelCoin, ibcCoin) + initCoins := sdk.NewCoins(stakeCoin, stbCoin, ibcCoin) setTotalSupply(app, ctx, accAmt, accNum) // fill all the addresses with some coins, set the loose pool tokens simultaneously diff --git a/x/curating/abci_test.go b/x/curating/abci_test.go index fac4e3d4c..3918fcf4b 100644 --- a/x/curating/abci_test.go +++ b/x/curating/abci_test.go @@ -18,7 +18,7 @@ func setup(t *testing.T) (*testdata.SimApp, sdk.Context) { postID := "500" vendorID := uint32(1) - deposit := sdk.NewInt64Coin("ufuel", 1_000_000) + deposit := sdk.NewInt64Coin("ustb", 1_000_000) addrs = testdata.AddTestAddrsIncremental(app, ctx, 3, sdk.NewInt(10_000_000)) err := app.CuratingKeeper.CreatePost( @@ -29,7 +29,7 @@ func setup(t *testing.T) (*testdata.SimApp, sdk.Context) { require.NoError(t, err) require.True(t, found, "post should be found") - creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ufuel") + creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ustb") require.Equal(t, "9000000", creatorBal.Amount.String()) // curator1 @@ -39,7 +39,7 @@ func setup(t *testing.T) (*testdata.SimApp, sdk.Context) { _, found, err = app.CuratingKeeper.GetUpvote(ctx, vendorID, postID, addrs[1]) require.NoError(t, err) require.True(t, found, "upvote should be found") - curator1Bal := app.BankKeeper.GetBalance(ctx, addrs[1], "ufuel") + curator1Bal := app.BankKeeper.GetBalance(ctx, addrs[1], "ustb") require.Equal(t, "8000000", curator1Bal.Amount.String(), "10 (initial bal) - 1 (deposit) - 1 (upvote)") @@ -50,7 +50,7 @@ func setup(t *testing.T) (*testdata.SimApp, sdk.Context) { _, found, err = app.CuratingKeeper.GetUpvote(ctx, vendorID, postID, addrs[2]) require.NoError(t, err) require.True(t, found, "upvote should be found") - curator2Bal := app.BankKeeper.GetBalance(ctx, addrs[2], "ufuel") + curator2Bal := app.BankKeeper.GetBalance(ctx, addrs[2], "ustb") require.Equal(t, "0", curator2Bal.Amount.String(), "10 (initial bal) - 1 (deposit) - 9 (upvote)") @@ -64,36 +64,36 @@ func setup(t *testing.T) (*testdata.SimApp, sdk.Context) { } // initial state -// creator = 10 FUEL -// curator1 = 10 FUEL, upvote 1 FUEL -// curator2 = 10 FUEL, upvote 9 FUEL +// creator = 10 STB +// curator1 = 10 STB, upvote 1 STB +// curator2 = 10 STB, upvote 9 STB // // qvf -// voting_pool = 10 FUEL +// voting_pool = 10 STB // root_sum = 4 // match_pool = 4^2 - 10 = 6 -// voter_reward = 5 FUEL +// voter_reward = 5 STB // match_reward = match_pool / 2 = 3 func TestEndBlockerExpiringPost(t *testing.T) { app, ctx := setup(t) // add funds to reward pool - funds := sdk.NewInt64Coin("ufuel", 10_000_000_000) + funds := sdk.NewInt64Coin("ustb", 10_000_000_000) err := app.BankKeeper.MintCoins(ctx, curating.RewardPoolName, sdk.NewCoins(funds)) require.NoError(t, err) curating.EndBlocker(ctx, app.CuratingKeeper) - // creator match reward = 0.5 * match_reward = 3 FUEL - creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ufuel") + // creator match reward = 0.5 * match_reward = 3 STB + creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ustb") require.Equal(t, "13000000", creatorBal.Amount.String(), "10 (initial) + 3 (creator match reward)") - curator1Bal := app.BankKeeper.GetBalance(ctx, addrs[1], "ufuel") + curator1Bal := app.BankKeeper.GetBalance(ctx, addrs[1], "ustb") require.Equal(t, "15500000", curator1Bal.Amount.String(), "8 (bal) + 1 (deposit) + 5 (voting reward) + 1.5 (match reward)") - curator2Bal := app.BankKeeper.GetBalance(ctx, addrs[2], "ufuel") + curator2Bal := app.BankKeeper.GetBalance(ctx, addrs[2], "ustb") require.Equal(t, "7500000", curator2Bal.Amount.String(), "0 (bal) + 1 (deposit) + 5 (voter reward) + 1.5 (match reward)") } @@ -102,22 +102,22 @@ func TestEndBlockerExpiringPostWithSmolRewardPool(t *testing.T) { app, ctx := setup(t) // add funds to reward pool - funds := sdk.NewInt64Coin("ufuel", 1_000_000) + funds := sdk.NewInt64Coin("ustb", 1_000_000) err := app.BankKeeper.MintCoins(ctx, curating.RewardPoolName, sdk.NewCoins(funds)) require.NoError(t, err) curating.EndBlocker(ctx, app.CuratingKeeper) - // creator match reward = 0.5 * match_reward = 3 FUEL - creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ufuel") + // creator match reward = 0.5 * match_reward = 3 STB + creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ustb") require.Equal(t, "10000500", creatorBal.Amount.String(), "10 (initial) + 3 (creator match reward)") - curator1Bal := app.BankKeeper.GetBalance(ctx, addrs[1], "ufuel") + curator1Bal := app.BankKeeper.GetBalance(ctx, addrs[1], "ustb") require.Equal(t, "14000249", curator1Bal.Amount.String(), "8 (bal) + 1 (deposit) + 5 (voting reward) + 1.5 (match reward)") - curator2Bal := app.BankKeeper.GetBalance(ctx, addrs[2], "ufuel") + curator2Bal := app.BankKeeper.GetBalance(ctx, addrs[2], "ustb") require.Equal(t, "6000249", curator2Bal.Amount.String(), "0 (bal) + 1 (deposit) + 5 (voter reward) + 1.5 (match reward)") } diff --git a/x/curating/keeper/post_test.go b/x/curating/keeper/post_test.go index 7d79a75f2..8afa0ec9b 100644 --- a/x/curating/keeper/post_test.go +++ b/x/curating/keeper/post_test.go @@ -14,7 +14,7 @@ func TestPost(t *testing.T) { _, app, ctx := testdata.CreateTestInput() vendorID := uint32(1) - deposit := sdk.NewInt64Coin("ufuel", 1000000) + deposit := sdk.NewInt64Coin("ustb", 1000000) addrs := testdata.AddTestAddrsIncremental(app, ctx, 3, sdk.NewInt(1000000)) err := app.CuratingKeeper.CreatePost(ctx, vendorID, postID, "body string", deposit, addrs[0], addrs[0]) @@ -24,7 +24,7 @@ func TestPost(t *testing.T) { require.NoError(t, err) require.True(t, found, "post should be found") - creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ufuel") + creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ustb") require.Equal(t, "0", creatorBal.Amount.String()) vps := app.CuratingKeeper.GetCurationQueueTimeSlice(ctx, ctx.BlockTime()) @@ -35,7 +35,7 @@ func TestPost_EmptyCreator(t *testing.T) { _, app, ctx := testdata.CreateTestInput() vendorID := uint32(1) - deposit := sdk.NewInt64Coin("ufuel", 1000000) + deposit := sdk.NewInt64Coin("ustb", 1000000) addrs := testdata.AddTestAddrsIncremental(app, ctx, 3, sdk.NewInt(1000000)) err := app.CuratingKeeper.CreatePost(ctx, vendorID, postID, "body string", deposit, nil, addrs[1]) @@ -45,10 +45,10 @@ func TestPost_EmptyCreator(t *testing.T) { require.NoError(t, err) require.True(t, found, "post should be found") - creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ufuel") + creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ustb") require.Equal(t, "1000000", creatorBal.Amount.String()) - rewardAccountBal := app.BankKeeper.GetBalance(ctx, addrs[1], "ufuel") + rewardAccountBal := app.BankKeeper.GetBalance(ctx, addrs[1], "ustb") require.Equal(t, "1000000", rewardAccountBal.Amount.String()) vps := app.CuratingKeeper.GetCurationQueueTimeSlice(ctx, ctx.BlockTime()) @@ -59,7 +59,7 @@ func TestPost_EmptyRewardAccount(t *testing.T) { _, app, ctx := testdata.CreateTestInput() vendorID := uint32(1) - deposit := sdk.NewInt64Coin("ufuel", 1000000) + deposit := sdk.NewInt64Coin("ustb", 1000000) addrs := testdata.AddTestAddrsIncremental(app, ctx, 3, sdk.NewInt(1000000)) err := app.CuratingKeeper.CreatePost(ctx, vendorID, postID, "body string", deposit, addrs[0], nil) @@ -69,7 +69,7 @@ func TestPost_EmptyRewardAccount(t *testing.T) { require.NoError(t, err) require.True(t, found, "post should be found") - creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ufuel") + creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ustb") require.Equal(t, "0", creatorBal.Amount.String()) vps := app.CuratingKeeper.GetCurationQueueTimeSlice(ctx, ctx.BlockTime()) @@ -80,7 +80,7 @@ func TestPost_WithRewardAccount(t *testing.T) { _, app, ctx := testdata.CreateTestInput() vendorID := uint32(1) - deposit := sdk.NewInt64Coin("ufuel", 1000000) + deposit := sdk.NewInt64Coin("ustb", 1000000) addrs := testdata.AddTestAddrsIncremental(app, ctx, 3, sdk.NewInt(1000000)) err := app.CuratingKeeper.CreatePost(ctx, vendorID, postID, "body string", deposit, addrs[0], addrs[1]) @@ -90,10 +90,10 @@ func TestPost_WithRewardAccount(t *testing.T) { require.NoError(t, err) require.True(t, found, "post should be found") - creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ufuel") + creatorBal := app.BankKeeper.GetBalance(ctx, addrs[0], "ustb") require.Equal(t, "0", creatorBal.Amount.String()) - rewardAccountBal := app.BankKeeper.GetBalance(ctx, addrs[1], "ufuel") + rewardAccountBal := app.BankKeeper.GetBalance(ctx, addrs[1], "ustb") require.Equal(t, "1000000", rewardAccountBal.Amount.String()) vps := app.CuratingKeeper.GetCurationQueueTimeSlice(ctx, ctx.BlockTime()) diff --git a/x/curating/keeper/reward_pool_test.go b/x/curating/keeper/reward_pool_test.go index 2c040ffc9..f0c38983d 100644 --- a/x/curating/keeper/reward_pool_test.go +++ b/x/curating/keeper/reward_pool_test.go @@ -19,7 +19,7 @@ func TestInflateRewards(t *testing.T) { blockInflation := app.BankKeeper.GetBalance(ctx, blockInflationAddr, types.DefaultStakeDenom) require.True(t, blockInflation.Amount.IsZero()) - fakeInflationCoin := sdk.NewInt64Coin("ufuel", 1000000) + fakeInflationCoin := sdk.NewInt64Coin("ustb", 1000000) err := app.BankKeeper.SetBalance(ctx, blockInflationAddr, fakeInflationCoin) app.AccountKeeper.SetModuleAccount(ctx, blockInflationAcct) require.NoError(t, err) diff --git a/x/curating/keeper/upvote_test.go b/x/curating/keeper/upvote_test.go index 2343dcc79..051abbba6 100644 --- a/x/curating/keeper/upvote_test.go +++ b/x/curating/keeper/upvote_test.go @@ -14,7 +14,7 @@ func TestCreateUpvote(t *testing.T) { postID := "500" vendorID := uint32(1) - deposit := sdk.NewInt64Coin("ufuel", 1000000) + deposit := sdk.NewInt64Coin("ustb", 1000000) addrs := testdata.AddTestAddrsIncremental(app, ctx, 3, sdk.NewInt(27_000_000)) err := app.CuratingKeeper.CreateUpvote(ctx, vendorID, postID, addrs[0], addrs[0], 5, deposit) @@ -28,9 +28,9 @@ func TestCreateUpvote(t *testing.T) { require.NoError(t, err) require.True(t, found, "upvote should be found") - require.Equal(t, "25000000ufuel", upvote.VoteAmount.String()) + require.Equal(t, "25000000ustb", upvote.VoteAmount.String()) - curatorBalance := app.BankKeeper.GetBalance(ctx, addrs[0], "ufuel") + curatorBalance := app.BankKeeper.GetBalance(ctx, addrs[0], "ustb") require.Equal(t, "1000000", curatorBalance.Amount.String()) } @@ -39,7 +39,7 @@ func TestCreateUpvote_ExistingPost(t *testing.T) { postID := "501" vendorID := uint32(1) - deposit := sdk.NewInt64Coin("ufuel", 1000000) + deposit := sdk.NewInt64Coin("ustb", 1000000) addrs := testdata.AddTestAddrsIncremental(app, ctx, 3, sdk.NewInt(27_000_000)) err := app.CuratingKeeper.CreatePost(ctx, vendorID, postID, "body string", deposit, addrs[1], addrs[1]) @@ -56,12 +56,12 @@ func TestCreateUpvote_ExistingPost(t *testing.T) { require.NoError(t, err) require.True(t, found, "upvote should be found") - require.Equal(t, "25000000ufuel", upvote.VoteAmount.String()) + require.Equal(t, "25000000ustb", upvote.VoteAmount.String()) - creatorBalance := app.BankKeeper.GetBalance(ctx, addrs[1], "ufuel") + creatorBalance := app.BankKeeper.GetBalance(ctx, addrs[1], "ustb") require.Equal(t, "26000000", creatorBalance.Amount.String()) - curatorBalance := app.BankKeeper.GetBalance(ctx, addrs[0], "ufuel") + curatorBalance := app.BankKeeper.GetBalance(ctx, addrs[0], "ustb") require.Equal(t, "1000000", curatorBalance.Amount.String()) } @@ -70,7 +70,7 @@ func TestCreateUpvote_ExistingUpvote(t *testing.T) { postID := "502" vendorID := uint32(1) - deposit := sdk.NewInt64Coin("ufuel", 1000000) + deposit := sdk.NewInt64Coin("ustb", 1000000) addrs := testdata.AddTestAddrsIncremental(app, ctx, 3, sdk.NewInt(27_000_000)) err := app.CuratingKeeper.CreatePost(ctx, vendorID, postID, "body string", deposit, addrs[1], addrs[1]) diff --git a/x/curating/quadratic_test.go b/x/curating/quadratic_test.go index f9e09d9c7..c29c6fc0a 100644 --- a/x/curating/quadratic_test.go +++ b/x/curating/quadratic_test.go @@ -18,7 +18,7 @@ func TestQVF(t *testing.T) { _, app, ctx := testdata.CreateTestInput() // add funds to reward pool - funds := sdk.NewInt64Coin("ufuel", 10_000_000) + funds := sdk.NewInt64Coin("ustb", 10_000_000) err := app.BankKeeper.MintCoins(ctx, curating.RewardPoolName, sdk.NewCoins(funds)) require.NoError(t, err) @@ -41,7 +41,7 @@ func TestQVFZeroVotes(t *testing.T) { _, app, ctx := testdata.CreateTestInput() // add funds to reward pool - funds := sdk.NewInt64Coin("ufuel", 10_000_000) + funds := sdk.NewInt64Coin("ustb", 10_000_000) err := app.BankKeeper.MintCoins(ctx, curating.RewardPoolName, sdk.NewCoins(funds)) require.NoError(t, err) diff --git a/x/curating/types/key.go b/x/curating/types/key.go index 3afb90069..d881aa5e7 100644 --- a/x/curating/types/key.go +++ b/x/curating/types/key.go @@ -27,7 +27,7 @@ const ( VotingPoolName = "voting_pool" // DefaultStakeDenom is the staking denom for the zone - DefaultStakeDenom = "ufuel" + DefaultStakeDenom = "ustb" ) var ( diff --git a/x/funding/client/cli/tx.go b/x/funding/client/cli/tx.go index 292520eff..0ebf38d5b 100644 --- a/x/funding/client/cli/tx.go +++ b/x/funding/client/cli/tx.go @@ -39,9 +39,9 @@ func GetCmdBuy(cdc *codec.Codec) *cobra.Command { return &cobra.Command{ Use: "buy [amount]", Args: cobra.MinimumNArgs(1), - Short: "Buy FUEL with ATOM reserves from the bonding curve", + Short: "Buy STB with ATOM reserves from the bonding curve", Long: strings.TrimSpace( - fmt.Sprintf(`Locks collateral that will be used as reserves for the bonding curve. Mints new FUEL. + fmt.Sprintf(`Locks collateral that will be used as reserves for the bonding curve. Mints new STB. Example: $ %s tx funding buy 1000stake --from mykey `, diff --git a/x/funding/types/key.go b/x/funding/types/key.go index 143594c35..0c71eb6c6 100644 --- a/x/funding/types/key.go +++ b/x/funding/types/key.go @@ -15,7 +15,7 @@ const ( Counterparty = "ibczeroxfer" CounterpartyDenom = "stake" - Denom = "ufuel" + Denom = "ustb" ) var (