Skip to content

Commit

Permalink
Clp/remove sourcechain (#344)
Browse files Browse the repository at this point in the history
* upgrade mod

* wip

* Working local version of simapp

* One working test.

* more refactoring

* wip

* wip

* some cleanup

* Keep cdc private

* moved bank handler to keeper.go

* merged develop

* fixed tests

* added unit test for bank funtionality

* constan for max Wbasis

* refactored handlers

* refactored handlers

* refactored handlers

* Script to duplicate bug 267

* Script to duplicate bug 267

* added supplykeeper

* added supplykeeper

* added supplykeeper

* Added tests for clp supplykeeper

* added test for module account

* removed excessive comments

* added api to query assets for lp

* changed to types address

* Feature/clp state export (#306)

* State Export and Tests for CLP

Co-authored-by: Jedi2002 <[email protected]>

* New Valdiations

* New Validations

* fixed minor problems

* configured gov module

* comment-clp

* Added upgrade and governance modules

* removed sourcechain and ticker

* removed sourcechain and ticker

* refactored tests

* gosum

* Generate genesis with the Gov module.

* added new go sum

* removed gov and upgrade modules

* removed gov and upgrade modules

* updated swagger docs

* updated genesis

Co-authored-by: utx0_ <[email protected]>
Co-authored-by: Kevin DeGraaf <[email protected]>
Co-authored-by: Jedi2002 <[email protected]>
Co-authored-by: intl-man <[email protected]>
Co-authored-by: utx0_ <[email protected]>
  • Loading branch information
6 people authored Dec 9, 2020
1 parent e3201b2 commit c42a335
Show file tree
Hide file tree
Showing 33 changed files with 322 additions and 647 deletions.
235 changes: 6 additions & 229 deletions api/openapi/sifchain-openapi.yml

Large diffs are not rendered by default.

23 changes: 15 additions & 8 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"encoding/json"
"github.com/Sifchain/sifnode/x/clp"
"github.com/cosmos/cosmos-sdk/x/auth/vesting"
tmos "github.com/tendermint/tendermint/libs/os"
"io"
"os"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

bam "github.com/cosmos/cosmos-sdk/baseapp"
Expand Down Expand Up @@ -46,7 +46,6 @@ var (
ethbridge.AppModuleBasic{},
)

// Module accounts which will be passed to the supply keeper when it is initialized
maccPerms = map[string][]string{
auth.FeeCollectorName: nil,
staking.BondedPoolName: {supply.Burner, supply.Staking},
Expand Down Expand Up @@ -87,9 +86,8 @@ type NewApp struct {
// Peggy keepers
EthBridgeKeeper ethbridge.Keeper
OracleKeeper oracle.Keeper

clpKeeper clp.Keeper
mm *module.Manager
clpKeeper clp.Keeper
mm *module.Manager

sm *module.SimulationManager
}
Expand All @@ -100,6 +98,7 @@ func NewInitApp(
logger log.Logger, db dbm.DB, traceStore io.Writer, loadLatest bool,
invCheckPeriod uint, baseAppOptions ...func(*bam.BaseApp),
) *NewApp {

cdc := MakeCodec()

bApp := bam.NewBaseApp(appName, logger, db, auth.DefaultTxDecoder(cdc), baseAppOptions...)
Expand Down Expand Up @@ -155,14 +154,14 @@ func NewInitApp(
maccPerms,
)

stakingKeeper := staking.NewKeeper(
app.StakingKeeper = staking.NewKeeper(
app.cdc,
keys[staking.StoreKey],
app.SupplyKeeper,
app.subspaces[staking.ModuleName],
)

app.StakingKeeper = *stakingKeeper.SetHooks(
app.StakingKeeper = *app.StakingKeeper.SetHooks(
staking.NewMultiStakingHooks(),
)

Expand Down Expand Up @@ -197,7 +196,15 @@ func NewInitApp(
clp.NewAppModule(app.clpKeeper, app.bankKeeper, app.SupplyKeeper),
)

app.mm.SetOrderEndBlockers(staking.ModuleName)
// there is nothing left over in the validator fee pool, so as to keep the
// CanWithdrawInvariant invariant.
app.mm.SetOrderBeginBlockers(
staking.ModuleName,
)

app.mm.SetOrderEndBlockers(
staking.ModuleName,
)

app.mm.SetOrderInitGenesis(
staking.ModuleName,
Expand Down
2 changes: 1 addition & 1 deletion cmd/sifgen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func nodeCreateCmd() *cobra.Command {
Args: cobra.MinimumNArgs(4),
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 4 {
sifgen.NewSifgen(&args[0]).NodeCreate(args[1], args[2], args[3],nil, nil)
sifgen.NewSifgen(&args[0]).NodeCreate(args[1], args[2], args[3], nil, nil)
} else {
sifgen.NewSifgen(&args[0]).NodeCreate(args[1], args[2], args[3], &args[4], &args[5])
}
Expand Down
4 changes: 2 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 1
accounts:
- name: user1
coins: ["1000token", "100000000stake" ,"1000000000rwn" ,"1000000000cdash" ,"1000000000ceth"]
coins: ["1000token", "10000000000stake" ,"1000000000rowan" ,"1000000000cdash" ,"1000000000ceth" ]
- name: user2
coins: ["1000token", "100000000stake" ,"1000000000rwn" ,"1000000000cdash","1000000000ceth"]
coins: ["1000token", "100000000stake" ,"1000000000rowan" ,"1000000000cdash","1000000000ceth"]
validator:
name: user1
staked: "100000000stake"
Expand Down
11 changes: 7 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
github.com/MakeNowJust/heredoc v1.0.0
github.com/allegro/bigcache v1.2.1 // indirect
github.com/aristanetworks/goarista v0.0.0-20201012165903-2cb20defcd66 // indirect
github.com/belitre/gotpl v0.0.0-20200305160433-cfded0e75742 // indirect
github.com/btcsuite/btcd v0.21.0-beta // indirect
github.com/cespare/cp v1.1.1 // indirect
github.com/cosmos/cosmos-sdk v0.39.1
Expand All @@ -20,7 +19,7 @@ require (
github.com/golang/protobuf v1.4.3 // indirect
github.com/google/go-cmp v0.5.2 // indirect
github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/google/uuid v1.1.1 // indirect
github.com/gorilla/mux v1.8.0
github.com/huin/goupnp v1.0.0 // indirect
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
Expand All @@ -29,6 +28,7 @@ require (
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.3 // indirect
github.com/mattn/go-colorable v0.1.7 // indirect
github.com/mattn/go-runewidth v0.0.4 // indirect
github.com/miguelmota/go-solidity-sha3 v0.1.0
github.com/mitchellh/mapstructure v1.3.3 // indirect
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect
Expand All @@ -50,13 +50,16 @@ require (
github.com/stretchr/testify v1.6.1
github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca // indirect
github.com/tendermint/go-amino v0.16.0
github.com/tendermint/tendermint v0.33.8
github.com/tendermint/tendermint v0.33.9
github.com/tendermint/tm-db v0.5.1
github.com/tyler-smith/go-bip39 v1.0.2
github.com/wsddn/go-ecdh v0.0.0-20161211032359-48726bab9208 // indirect
github.com/yelinaung/go-haikunator v0.0.0-20150320004105-1249cae259af
golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect
google.golang.org/protobuf v1.25.0 // indirect
golang.org/x/net v0.0.0-20201110031124-69a78807bb2b // indirect
golang.org/x/sys v0.0.0-20201126233918-771906719818 // indirect
golang.org/x/text v0.3.4 // indirect
google.golang.org/genproto v0.0.0-20201119123407-9b1e624d6bc4 // indirect
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f
gopkg.in/ini.v1 v1.61.0 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
Expand Down
Loading

0 comments on commit c42a335

Please sign in to comment.