Skip to content

Commit

Permalink
Merge pull request #143 from public-awesome/fuel-to-stb
Browse files Browse the repository at this point in the history
FUEL -> STB, closes #138
  • Loading branch information
JakeHartnell authored Aug 19, 2020
2 parents 7b9ee3b + 628a7f5 commit 516c977
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 59 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import (
const (
appName = "stake"
// DefaultStakeDenom for Stakebird
DefaultStakeDenom = "ufuel"
DefaultStakeDenom = "ustb"

// DefaultUnbondingPeriod for Stakebird
DefaultUnbondingPeriod = "504h"
Expand Down
4 changes: 2 additions & 2 deletions contrib/ci/chains/stakebird.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 1 addition & 1 deletion contrib/ci/setup-stakebird.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GAIA_TAG="goz-phase-3"
DENOM=ufuel
DENOM=ustb
CHAINID=stakebird
RLYKEY=stake10dmk2q0numq3v0s7vwsx20dm4hq040vsawpj35
make install
Expand Down
4 changes: 2 additions & 2 deletions contrib/ibc/relayer/configs/stakebird-xfer/ibc1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
4 changes: 2 additions & 2 deletions docker/entry-point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions docker/test-entry-point.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
2 changes: 1 addition & 1 deletion testdata/sim_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions testdata/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 19 additions & 19 deletions x/curating/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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
Expand All @@ -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)")

Expand All @@ -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)")

Expand All @@ -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)")
}
Expand All @@ -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)")
}
20 changes: 10 additions & 10 deletions x/curating/keeper/post_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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())
Expand All @@ -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])
Expand All @@ -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())
Expand All @@ -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)
Expand All @@ -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())
Expand All @@ -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])
Expand All @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion x/curating/keeper/reward_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
16 changes: 8 additions & 8 deletions x/curating/keeper/upvote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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())
}

Expand All @@ -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])
Expand All @@ -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())
}

Expand All @@ -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])
Expand Down
4 changes: 2 additions & 2 deletions x/curating/quadratic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion x/curating/types/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
VotingPoolName = "voting_pool"

// DefaultStakeDenom is the staking denom for the zone
DefaultStakeDenom = "ufuel"
DefaultStakeDenom = "ustb"
)

var (
Expand Down
4 changes: 2 additions & 2 deletions x/funding/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
`,
Expand Down
Loading

0 comments on commit 516c977

Please sign in to comment.