Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: dfinance/dnode
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.7.2
Choose a base ref
...
head repository: dfinance/dnode
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: release-v0.7
Choose a head ref

Commits on Oct 6, 2020

  1. Master: [DFI-873] simulator update, Cosmos SDK bump, genesis update (#…

    …211)
    
    * [DFI-873] simulator: rewards lock added, LP staking added, major refactoring; ccstorage: LPT default currency added
    
    * [DFI-873] simulator: refactoring, undelegateOp fix
    
    * [DFI-873] simulator: Linter fixes
    
    * [DFI-873] unified app default GenesisState override func added and used for Simulator
    
    * All genesis params are gathered in one place; major defaults refactoring (circular dep fix); Cosmos SDK version bump
    Mikhail Kornilov authored Oct 6, 2020
    Copy the full SHA
    7969d14 View commit details

Commits on Oct 7, 2020

  1. genesis: PublicTreasuryPool capacity default value fix; DVM stdlib v0…

    ….7 update (#213)
    Mikhail Kornilov authored Oct 7, 2020
    Copy the full SHA
    4096f03 View commit details

Commits on Oct 8, 2020

  1. Copy the full SHA
    6d08080 View commit details

Commits on Oct 12, 2020

  1. Feature simulator update, Cosmos SDK update (#216)

    * simulator: readme added, refactoring, new Cosmos SDK query results added to the report
    
    * Cosmos SDK version bump
    
    * genesis update: LPRation 1.0 -> 2.0
    Mikhail Kornilov authored Oct 12, 2020
    Copy the full SHA
    ebab389 View commit details

Commits on Oct 13, 2020

  1. [DFI-753] migrate swagger to dfinance cosmos-sdk version (#218)

    * [DFI-753] migrate swagger to dfinance cosmos-sdk version
    
    * Cosmos SDK version bump, Swagger update
    
    * go mod tidy
    
    Co-authored-by: Mikhail Kornilov <mikhailkornilov@wings.ai>
    g3co and Mikhail Kornilov authored Oct 13, 2020
    Copy the full SHA
    c7eaa78 View commit details

Commits on Oct 14, 2020

  1. VM mod: request retry in process logs added (#219)

    Mikhail Kornilov authored Oct 14, 2020
    Copy the full SHA
    eda0829 View commit details

Commits on Oct 16, 2020

  1. fixed macos build (#220)

    g3co authored Oct 16, 2020
    Copy the full SHA
    e53e828 View commit details
  2. Copy the full SHA
    8d68e58 View commit details

Commits on Oct 20, 2020

  1. [DFI-908,DFI-910] Cosmos SDK version fix, Swagger update (#225)

    * [DFI-908,DFI-910] Cosmos SDK version fix (simulator updated), auto Cosmos SDK version fetch for Swagger build, Swagger updated
    
    * Fix for running local tests on OS X
    Mikhail Kornilov authored Oct 20, 2020
    Copy the full SHA
    7fa4581 View commit details

Commits on Oct 22, 2020

  1. [DFI-850] dvm multi module compile (#224)

    * [DFI-850] prev version compatibility
    
    * [DFI-850] added multiple compilation and tests
    
    * [DFI-850] added metadata info
    
    * [DFI-850] mapping proto fields
    
    * [DFI-850] fixed dep
    
    * [DFI-850] added mixed content compilation test
    
    * [DFI-850] fixed compilationUnit name
    
    * [DFI-850] fixed test
    
    * [DFI-850] added multi publish
    
    * [DFI-850] added multi publish v2
    
    * [DFI-850] added test for cli/rest
    
    * [DFI-850] added test for cli/rest
    
    * [DFI-850] added integ test
    
    * [DFI-850] fixes
    g3co authored Oct 22, 2020
    Copy the full SHA
    18871c7 View commit details
  2. Copy the full SHA
    56604f0 View commit details

Commits on Oct 26, 2020

  1. [Master][DFI-924] Ledger cross build (#229)

    * [DFI-924] Ledger cross-OS build using XGO
    
    * go mod tidy
    Mikhail Kornilov authored Oct 26, 2020
    Copy the full SHA
    bb5eb26 View commit details

Commits on Oct 28, 2020

  1. [Master][DFI-931] Fix for duplicate messages in the event log (#232)

    * [DFI-931] new event manager for each messages
    
    * [DFI-931] returned event type
    
    * [DFI-931] revert baseapp changes
    
    * [DFI-931] added reset ctx for module handlers
    
    * [DFI-931] added test tag
    g3co authored Oct 28, 2020
    Copy the full SHA
    eccb5be View commit details

Commits on Nov 3, 2020

  1. Copy the full SHA
    f208a41 View commit details

Commits on Nov 5, 2020

  1. [Master][DFI-928] Mainnet v1.0 migration (#235)

    * [DFI-929] migration to v1.0 added; MaxSelfStake staking param support added
    
    * [DFI-929] fixed CSDK version
    
    * [DFI-928] BaseMigrate -> Migrate renaming
    
    * [DFI-929] defaults and restrictions modified to match v1.0 release
    
    * [DFI-947] CSDK version bump
    
    * [DFI-929] appState export update to support zero-height genesis export
    
    * [DFI-929] multisig, orderbook mods: PrepareForZeroHeight squash funcs added
    
    * [DFI-929] multisig mod: call queue fix for genesis squash; app export refactoring, debug added
    
    * [DFI-929] ccstorage, vmauth mods: PrepareForZeroHeight added; mainnet export config added
    
    * [DFI-929] mint mod PrepareForZeroHeight support added
    
    * [DFI-929] gov mod PrepareForZeroHeight support added
    
    * [DFI-947] Mainnet v1.0 migration fixes and report generation
    
    * [DFI-947] Debug validator disabled
    
    * [DFI-947] Mainnet v1.0 export report modification to support a newer CSDK version (BankRewards per validator)
    
    * Linter fixes; tests skip due to changed app limitation; simulator fix to support new distr RewardsBank API
    
    * CLItester fix: increased init acc balance as Gov deposit increased)
    
    * CSDK version bump
    Mikhail Kornilov authored Nov 5, 2020
    Copy the full SHA
    aa2b01e View commit details
  2. Copy the full SHA
    969442f View commit details

Commits on Nov 12, 2020

  1. [master][DFI-953] added name field in the VM compilation result (#238)

    * [DFI-953] added name field in the VM compilation result
    
    * [DFI-953] add seed for rand in sentry integration
    g3co authored Nov 12, 2020
    Copy the full SHA
    cf749a2 View commit details

Commits on Dec 3, 2020

  1. [master][DFI-963,DFI-964] Fixed keyring dependency and GitHub Actions (

    …#239)
    
    * [DFI-963] Fixed keyring dependency
    
    * [DFI-963] Fixed keyring dependency, v2
    
    * [DFI-963] Fixed keyring dependency, v3
    
    * [DFI-963] Fixed keyring dependency, v3
    
    * [DFI-963] GHA fix
    
    * [DFI-963] GHA fix
    
    * [DFI-963] GHA fix
    
    * [DFI-963] Fixed keyring dependency
    
    * [DFI-963] Fixed keyring dependency
    
    * [DFI-963] Fixed lint version
    
    * [DFI-963] updated linter action version
    g3co authored Dec 3, 2020
    Copy the full SHA
    4c8da42 View commit details
  2. Copy the full SHA
    9a91bd6 View commit details
  3. Copy the full SHA
    cf6d017 View commit details

Commits on Dec 15, 2020

  1. Copy the full SHA
    84810b2 View commit details

Commits on Mar 4, 2021

  1. [Release v0.7] [DFI-908,DFI-910] Cosmos SDK version fix, Swagger upda…

    …te (#227)
    
    * [DFI-908,DFI-910] Cosmos SDK version fix, Swagger update
    
    * go mod tidy
    
    * Switched CSDK to v0.39.1-0.2 which has no appHash changes
    Mikhail Kornilov authored and Nikita Volkov committed Mar 4, 2021
    Copy the full SHA
    aba1583 View commit details

Commits on Mar 16, 2021

  1. [Release v0.7] [DFI-908,DFI-910] Cosmos SDK version fix, Swagger upda…

    …te (#227) (#233)
    
    * [DFI-908,DFI-910] Cosmos SDK version fix, Swagger update
    
    * go mod tidy
    
    * Switched CSDK to v0.39.1-0.2 which has no appHash changes
    
    pump version
    
    Co-authored-by: Mikhail Kornilov <mikhailkornilov@wings.ai>
    g3co and Mikhail Kornilov authored Mar 16, 2021
    Copy the full SHA
    7121d09 View commit details
  2. Copy the full SHA
    cf90fa2 View commit details
Showing with 7,542 additions and 2,739 deletions.
  1. +4 −4 .github/workflows/main.yml
  2. +43 −17 Makefile
  3. +1 −19 app/app.go
  4. +4 −0 app/cli_test.go
  5. +19 −13 app/common_test.go
  6. +307 −0 app/export.go
  7. +729 −0 app/export_v10.go
  8. +31 −12 app/integ_app_test.go
  9. +13 −13 app/integ_gov_test.go
  10. +177 −33 app/integ_test.go
  11. +2 −0 app/rest_test.go
  12. +2 −2 app/unit_currencies_test.go
  13. +3 −2 app/unit_distribution_test.go
  14. +333 −0 app/unit_handlers_test.go
  15. +20 −0 cmd/config/bech_config.go
  16. +1 −2 cmd/config/cli_config.go
  17. +0 −125 cmd/config/config.go
  18. +0 −211 cmd/config/gen_init.go
  19. +140 −0 cmd/config/genesis/cmd_init.go
  20. +75 −0 cmd/config/genesis/defaults/common_defaults.go
  21. +281 −0 cmd/config/genesis/genesis.go
  22. +4 −18 cmd/config/restrictions/restrictions.go
  23. +85 −0 cmd/config/vm_config.go
  24. +2,117 −670 cmd/dncli/docs/swagger.go
  25. +6 −5 cmd/dncli/main.go
  26. +2 −2 cmd/dnode/main.go
  27. +0 −410 cmd/dnode/testnet.go
  28. +13 −7 go.mod
  29. +60 −50 go.sum
  30. +1 −0 helpers/logger/sentry_test.go
  31. +20 −20 helpers/tests/clitester/cli_tester_configs.go
  32. +4 −8 helpers/tests/clitester/cli_tester_init.go
  33. +7 −11 helpers/tests/clitester/cli_tester_rest.go
  34. +2 −2 helpers/tests/clitester/types_tx.go
  35. +148 −0 helpers/tests/simulator/README.md
  36. +172 −32 helpers/tests/simulator/inflation_test.go
  37. +64 −72 helpers/tests/simulator/sim.go
  38. +105 −2 helpers/tests/simulator/sim_account.go
  39. +33 −120 helpers/tests/simulator/sim_helpers.go
  40. +22 −23 helpers/tests/simulator/sim_invariant.go
  41. +45 −7 helpers/tests/simulator/sim_operation.go
  42. +0 −362 helpers/tests/simulator/sim_ops.go
  43. +83 −0 helpers/tests/simulator/sim_ops_create_validator.go
  44. +158 −0 helpers/tests/simulator/sim_ops_delegate.go
  45. +174 −0 helpers/tests/simulator/sim_ops_redelegate.go
  46. +84 −0 helpers/tests/simulator/sim_ops_rewards_delegator.go
  47. +77 −0 helpers/tests/simulator/sim_ops_rewards_lock.go
  48. +86 −0 helpers/tests/simulator/sim_ops_rewards_validator.go
  49. +136 −0 helpers/tests/simulator/sim_ops_undelegate.go
  50. +7 −10 helpers/tests/simulator/sim_options.go
  51. +41 −3 helpers/tests/simulator/sim_queries.go
  52. +77 −28 helpers/tests/simulator/sim_report.go
  53. +69 −24 helpers/tests/simulator/sim_report_csv.go
  54. +1 −1 helpers/tests/simulator/sim_report_debug.go
  55. +78 −18 helpers/tests/simulator/sim_txs.go
  56. +132 −1 helpers/tests/simulator/sim_validator.go
  57. +4 −0 x/ccstorage/alias.go
  58. +50 −0 x/ccstorage/internal/keeper/squash.go
  59. +4 −0 x/ccstorage/internal/types/genesis.go
  60. +2 −2 x/core/ante_decor_common.go
  61. +2 −2 x/core/ante_decor_denom.go
  62. +2 −0 x/currencies/handler.go
  63. +1 −1 x/currencies/internal/keeper/genesis.go
  64. +4 −4 x/currencies/internal/keeper/genesis_test.go
  65. +13 −13 x/currencies/internal/keeper/issue.go
  66. +2 −0 x/markets/handler.go
  67. +0 −38 x/migration/internal/migrations/v0_7/migration.go
  68. +71 −0 x/migration/internal/migrations/v1_0/migration.go
  69. +2 −2 x/migration/internal/types/migration.go
  70. +2 −0 x/multisig/handler.go
  71. +8 −2 x/multisig/internal/keeper/call.go
  72. +1 −1 x/multisig/internal/keeper/call_test.go
  73. +25 −0 x/multisig/internal/keeper/squash.go
  74. +2 −0 x/oracle/handler.go
  75. +35 −0 x/orderbook/internal/keeper/squash.go
  76. +2 −0 x/orders/handler.go
  77. +2 −0 x/vm/alias.go
  78. +17 −7 x/vm/client/cli/queries.go
  79. +47 −16 x/vm/client/cli/tx.go
  80. +34 −20 x/vm/client/rest/rest.go
  81. +2 −2 x/vm/client/rest/swagger.go
  82. +20 −21 x/vm/client/vm_client/args.go
  83. +14 −14 x/vm/client/vm_client/args_test.go
  84. +79 −16 x/vm/client/vm_client/compiler.go
  85. +40 −0 x/vm/client/vm_client/types.go
  86. +1 −1 x/vm/gov_handler.go
  87. +1 −0 x/vm/handler.go
  88. +48 −28 x/vm/internal/keeper/genesis_ws.json
  89. +456 −119 x/vm/internal/keeper/integ_test.go
  90. +26 −22 x/vm/internal/keeper/keeper.go
  91. +10 −3 x/vm/internal/keeper/keeper_ds.go
  92. +1 −6 x/vm/internal/keeper/keeper_ds_test.go
  93. +1 −1 x/vm/internal/keeper/keeper_test.go
  94. +11 −7 x/vm/internal/keeper/vm_grpc.go
  95. +1 −9 x/vm/internal/keeper/vm_grpc_test.go
  96. +3 −3 x/vm/internal/types/msg_deploy_module.go
  97. +4 −4 x/vm/internal/types/msg_deploy_module_test.go
  98. +4 −4 x/vm/internal/types/msg_execute_script.go
  99. +5 −5 x/vm/internal/types/msg_execute_script_test.go
  100. +8 −7 x/vm/internal/types/utils.go
  101. +4 −0 x/vmauth/alias.go
  102. +173 −0 x/vmauth/internal/keeper/squash.go
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -9,9 +9,9 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v1
uses: golangci/golangci-lint-action@v2
with:
version: v1.26
version: v1.32
args: --exclude 'unused' --timeout=10m

test-build:
@@ -20,8 +20,8 @@ jobs:
steps:
- name: Set GOPATH
run: |
echo "::set-env name=GOPATH::${{ github.workspace }}/go"
echo "::add-path::${{ github.workspace }}/go/bin"
echo "GOPATH=${{ github.workspace }}/go" >> $GITHUB_ENV
echo "${{ github.workspace }}/go/bin" >> $GITHUB_PATH
shell: bash

- name: Install Go 1.14.6
60 changes: 43 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include Makefile.ledger

git_tag=$(shell git describe --tags $(git rev-list --tags --max-count=1))
git_tag=$(shell git describe --tags --abbrev=0)
git_commit=$(shell git rev-list -1 HEAD)
tags = -X github.com/cosmos/cosmos-sdk/version.Name=dfinance \
-X github.com/cosmos/cosmos-sdk/version.ServerName=dnode \
@@ -14,7 +14,7 @@ cosmos_dir=$(swagger_dir)/cosmos-sdk
dnode = ./cmd/dnode
dncli =./cmd/dncli

cosmos_version = v0.39.1
cosmos_version = $(shell awk '/replace github.com\/cosmos\/cosmos-sdk => github.com\/dfinance\/cosmos-sdk/ {print $$NF}' < go.mod)

all: install
install: go.sum install-dnode install-dncli
@@ -51,27 +51,47 @@ go.sum: go.mod
GO111MODULE=on go mod verify

swagger-ui-deps:
@echo "--> Preparing deps fro building Swagger API specificaion"
@echo "--> Preparing deps for building Swagger API specificaion"

@echo "-> Make tmp build folder"
rm -rf $(swagger_dir)
mkdir -p $(cosmos_dir)

@echo "-> Cosmos-SDK $(cosmos_version) checkout"
git -C $(swagger_dir) clone --branch $(cosmos_version) https://github.com/cosmos/cosmos-sdk.git
git -C $(swagger_dir) clone --depth 1 --branch $(cosmos_version) https://github.com/dfinance/cosmos-sdk.git

@echo "-> Fetching Golang libraries: swag, statik"
go get -u github.com/swaggo/swag/cmd/swag
go get -u github.com/swaggo/swag/cmd/swag@v1.6.7
go get github.com/g3co/go-swagger-merger

swagger-ui-build:
swagger_auto_dir=$(swagger_dir)"/swagger-auto"
modules_dir = ./x
swagger-ui-build: $(modules_dir)/*
@echo "--> Building Swagger API specificaion, merging it to Cosmos SDK"

@echo "-> Build swagger.yaml (that takes time)"
swag init --dir . --output $(swagger_dir) --generalInfo ./cmd/dnode/main.go --parseDependency

@echo "-> Merging swagger files"
go-swagger-merger -o ./cmd/dncli/docs/swagger.yaml $(swagger_dir)/swagger.yaml $(cosmos_dir)/client/lcd/swagger-ui/swagger.yaml
@echo "-> Build swagger.yaml"
rm -rf $(swagger_auto_dir)
mkdir -p $(swagger_auto_dir)/x
@echo "swagger: '2.0'"> $(swagger_auto_dir)/swagger.yaml

# generate swagger files for the each module
# creates tmp dirs for sdk types in the each dir and removes it after work
for file in $^ ; do \
cp -r $(cosmos_dir)/types ./$${file}/tmp_sdk; \
mkdir -p ./$${file}/tmp_auth; \
cp $(cosmos_dir)/x/auth/types/stdtx.go ./$${file}/tmp_auth; \
swag init --dir ./$${file} --output $(swagger_auto_dir)/$${file} --generalInfo ./module.go; \
rm -rf ./$${file}/tmp_sdk ./$${file}/tmp_auth; \
done

# merge autogenerated module swaggers
for file in $(swagger_auto_dir)/x/* ; do \
go-swagger-merger -o $(swagger_auto_dir)/swagger.yaml $(swagger_auto_dir)/swagger.yaml $${file}/swagger.yaml; \
done

# merge with the cosmos-sdk swagger
go-swagger-merger -o ./cmd/dncli/docs/swagger.yaml \
$(cosmos_dir)/client/lcd/swagger-auto/swagger.yaml \
$(swagger_auto_dir)/swagger.yaml

@echo "-> Building swagger.go file"
echo "// Code generated by Makefile. DO NOT EDIT.\n" > ./cmd/dncli/docs/swagger.go
@@ -82,9 +102,15 @@ swagger-ui-build:

## binaries builds (xgo required: https://github.com/karalabe/xgo)
binaries: go.sum
@echo ${git_tag}
@echo "Prepare XGO dependencies"
mkdir -p ./builds
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build --ldflags "$(tags)" -tags "$(build_tags)" -o ./builds/dncli-${git_tag}-darwin-amd64 ${dncli}
#GOOS=linux GOARCH=386 CGO_ENABLED=0 GO111MODULE=on go build --ldflags "$(tags)" -tags "$(build_tags)" -o ./builds/dncli-${git_tag}-linux-386 ${dncli}
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build --ldflags "$(tags)" -tags "$(build_tags)" -o ./builds/dncli-${git_tag}-linux-amd64 ${dncli}
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build --ldflags "$(tags)" -tags "$(build_tags)" -o ./builds/dncli-${git_tag}-windows-amd64.exe ${dncli}
#GOOS=windows GOARCH=386 CGO_ENABLED=0 GO111MODULE=on go build --ldflags "$(tags)" -tags "$(build_tags)" -o ./builds/dncli-${git_tag}-windows-386.exe ${dncli}
go get github.com/crazy-max/xgo

@echo "Build targets (Go 1.14): windows/amd64, linux/amd64, darwin/amd64"
xgo -go 1.14.x --ldflags='$(tags)' --tags='ledger' --out='./builds/dncli-${git_tag}' -targets='windows/amd64,linux/amd64,darwin/amd64' ${dncli}

## Legacy builds (as a reference)
#GOOS=darwin GOARCH=amd64 GO111MODULE=on go build --ldflags "$(tags)" -tags "$(build_tags)" -o ./builds/dncli-${git_tag}-darwin-amd64 ${dncli}
#GOOS=linux GOARCH=amd64 GO111MODULE=on go build --ldflags "$(tags)" -tags "$(build_tags)" -o ./builds/dncli-${git_tag}-linux-amd64 ${dncli}
#GOOS=windows GOARCH=amd64 GO111MODULE=on go build --ldflags "$(tags)" -tags "$(build_tags)" -o ./builds/dncli-${git_tag}-windows-amd64.exe ${dncli}
20 changes: 1 addition & 19 deletions app/app.go
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ import (
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmOs "github.com/tendermint/tendermint/libs/os"
tmTypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"
"google.golang.org/grpc"

@@ -455,6 +454,7 @@ func NewDnServiceApp(logger log.Logger, db dbm.DB, config *config.VMConfig, invC

// GovernanceKeeper allows changing chain module params.
app.govRouter = gov.NewRouter()
app.govRouter.AddRoute(gov.RouterKey, gov.ProposalHandler)
app.govRouter.AddRoute(vm.GovRouterKey, vm.NewGovHandler(app.vmKeeper))
app.govRouter.AddRoute(currencies.GovRouterKey, currencies.NewGovHandler(app.ccKeeper))
app.govRouter.AddRoute(distribution.RouterKey, distribution.NewProposalHandler(app.distrKeeper))
@@ -618,21 +618,3 @@ func (app *DnServiceApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) a
func (app *DnServiceApp) LoadHeight(height int64) error {
return app.LoadVersion(height, app.keys[bam.MainStoreKey])
}

// Exports genesis and validators.
func (app *DnServiceApp) ExportAppStateAndValidators(forZeroHeight bool, jailWhiteList []string,
) (appState json.RawMessage, validators []tmTypes.GenesisValidator, err error) {

// as if they could withdraw from the start of the next block.
ctx := app.NewContext(true, abci.Header{Height: app.LastBlockHeight()})

genState := app.mm.ExportGenesis(ctx)
appState, err = codec.MarshalJSONIndent(app.cdc, genState)
if err != nil {
return nil, nil, err
}

validators = staking.WriteValidators(ctx, app.stakingKeeper)

return appState, validators, nil
}
4 changes: 4 additions & 0 deletions app/cli_test.go
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ const (

// TestBankSXFI_CLI transfers for sxfi token must be disallowed
func TestBankSXFI_CLI(t *testing.T) {
t.Skip("skipped as dist limitations are disabled for the Mainnet")
t.Parallel()

ct := cliTester.New(t, false)
@@ -56,6 +57,7 @@ func TestBankSXFI_CLI(t *testing.T) {

// TestGovSXFI_CLI gov deposit allowed just for sxfi token
func TestGovSXFI_CLI(t *testing.T) {
t.Skip("test skipped as it is no longer relevant for Mainnet")
t.Parallel()

ct := cliTester.New(t, false)
@@ -71,6 +73,7 @@ func TestGovSXFI_CLI(t *testing.T) {

// TestStakeSXFI_CLI staking allowed just for sxfi token
func TestStakeSXFI_CLI(t *testing.T) {
t.Skip("skipped as dist limitations are disabled for the Mainnet")
t.Parallel()

ct := cliTester.New(t, false)
@@ -305,6 +308,7 @@ func TestCurrencies_CLI(t *testing.T) {

// Check that distribution commands in CLI disabled.
func TestDisableRewards_CLI(t *testing.T) {
t.Skip("skipped as dist limitations are disabled for the Mainnet")
t.Parallel()

ct := cliTester.New(t, false)
32 changes: 19 additions & 13 deletions app/common_test.go
Original file line number Diff line number Diff line change
@@ -21,6 +21,8 @@ import (
"github.com/cosmos/cosmos-sdk/x/mint"
"github.com/cosmos/cosmos-sdk/x/staking"
"github.com/cosmos/cosmos-sdk/x/supply"
"github.com/dfinance/dvm-proto/go/compiler_grpc"
"github.com/dfinance/dvm-proto/go/metadata_grpc"
"github.com/dfinance/dvm-proto/go/vm_grpc"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/tendermint/abci/types"
@@ -31,8 +33,8 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/test/bufconn"

dnConfig "github.com/dfinance/dnode/cmd/config"
vmConfig "github.com/dfinance/dnode/cmd/config"
"github.com/dfinance/dnode/cmd/config/genesis/defaults"
"github.com/dfinance/dnode/cmd/config/restrictions"
"github.com/dfinance/dnode/helpers/tests"
"github.com/dfinance/dnode/x/currencies"
@@ -183,9 +185,10 @@ func MockVMConfig() *vmConfig.VMConfig {

// VMServer aggregates gRPC VM services.
type VMServer struct {
vm_grpc.UnimplementedVMCompilerServer
vm_grpc.UnimplementedVMModulePublisherServer
vm_grpc.UnimplementedVMScriptExecutorServer
VMCompilerServer compiler_grpc.UnimplementedDvmCompilerServer
VMMetaDataServer metadata_grpc.UnimplementedDVMBytecodeMetadataServer
VMModulePublisherServer vm_grpc.UnimplementedVMModulePublisherServer
VMScriptExecutorServer vm_grpc.UnimplementedVMScriptExecutorServer
}

// NewTestDnAppMockVM creates dnode app and mock VM server.
@@ -197,9 +200,10 @@ func NewTestDnAppMockVM(logOpts ...log.Option) (*DnServiceApp, func()) {
vmServer := VMServer{}
server := grpc.NewServer()

vm_grpc.RegisterVMCompilerServer(server, &vmServer.UnimplementedVMCompilerServer)
vm_grpc.RegisterVMModulePublisherServer(server, &vmServer.UnimplementedVMModulePublisherServer)
vm_grpc.RegisterVMScriptExecutorServer(server, &vmServer.UnimplementedVMScriptExecutorServer)
compiler_grpc.RegisterDvmCompilerServer(server, &vmServer.VMCompilerServer)
metadata_grpc.RegisterDVMBytecodeMetadataServer(server, &vmServer.VMMetaDataServer)
vm_grpc.RegisterVMModulePublisherServer(server, &vmServer.VMModulePublisherServer)
vm_grpc.RegisterVMScriptExecutorServer(server, &vmServer.VMScriptExecutorServer)

go func() {
if err := server.Serve(vmListener); err != nil {
@@ -369,13 +373,15 @@ func GetGenesis(app *DnServiceApp, chainID, monikerID string, nodeAccPrivKey sec

stakingGenesis := staking.GenesisState{}
app.cdc.MustUnmarshalJSON(genesisState[staking.ModuleName], &stakingGenesis)
stakingGenesis.Params.BondDenom = dnConfig.MainDenom
stakingGenesis.Params.BondDenom = defaults.MainDenom
maxStakingLvl, _ := sdk.NewIntFromString("1000000000000000000000000")
stakingGenesis.Params.MaxSelfDelegationLvl = maxStakingLvl
genesisState[staking.ModuleName] = codec.MustMarshalJSONIndent(app.cdc, stakingGenesis)

// update mint denom
mintGenesis := mint.GenesisState{}
app.cdc.MustUnmarshalJSON(genesisState[mint.ModuleName], &mintGenesis)
mintGenesis.Params.MintDenom = dnConfig.MainDenom
mintGenesis.Params.MintDenom = defaults.MainDenom
genesisState[mint.ModuleName] = codec.MustMarshalJSONIndent(app.cdc, mintGenesis)

oracleGenesis := oracle.GenesisState{
@@ -408,14 +414,14 @@ func GetGenesis(app *DnServiceApp, chainID, monikerID string, nodeAccPrivKey sec
msg := staking.NewMsgCreateValidator(
nodeAcc.Address.Bytes(),
nodeAcc.PubKey,
sdk.NewCoin(dnConfig.MainDenom, tokenAmount),
sdk.NewCoin(defaults.MainDenom, tokenAmount),
staking.NewDescription(monikerID, "", "", "", ""),
staking.NewCommissionRates(commissionRate, commissionMaxRate, commissionChangeRate),
minSelfDelegation,
)

txFee := auth.StdFee{
Amount: sdk.Coins{{Denom: dnConfig.MainDenom, Amount: sdk.NewInt(1)}},
Amount: sdk.Coins{{Denom: defaults.MainDenom, Amount: sdk.NewInt(1)}},
Gas: defGasAmount,
}
txMemo := "testmemo"
@@ -503,7 +509,7 @@ func GenTx(msgs []sdk.Msg, accnums []uint64, seq []uint64, priv ...crypto.PrivKe
memo := "testmemotestmemo"

fee := auth.StdFee{
Amount: sdk.Coins{{Denom: dnConfig.MainDenom, Amount: sdk.NewInt(1)}},
Amount: sdk.Coins{{Denom: defaults.MainDenom, Amount: sdk.NewInt(1)}},
Gas: defGasAmount,
}

@@ -524,7 +530,7 @@ func GenTx(msgs []sdk.Msg, accnums []uint64, seq []uint64, priv ...crypto.PrivKe

// GenDefCoins returns Coins with xfi amount.
func GenDefCoins(t *testing.T) sdk.Coins {
coins, err := sdk.ParseCoins("1000000000000000000000" + dnConfig.MainDenom)
coins, err := sdk.ParseCoins("1000000000000000000000" + defaults.MainDenom)
if t != nil {
require.NoError(t, err)
}
Loading