0g-chain/x/bep3/genesis_test.go

392 lines
13 KiB
Go
Raw Normal View History

[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
package bep3_test
import (
"testing"
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
"cosmossdk.io/math"
Update cosmos-sdk to v0.47.7 (#1811) * Update cometbft, cosmos, ethermint, and ibc-go * Replace github.com/tendermint/tendermint by github.com/cometbft/cometbft * Replace github.com/tendermint/tm-db by github.com/cometbft/cometbft-db * Replace gogo/protobuf with cosmos/gogoproto & simapp replacement * Replace cosmos-sdk/simapp/helpers with cosmos-sdk/testutil/sims * Remove no longer used simulations * Replace ibchost with ibcexported See https://github.com/cosmos/ibc-go/blob/v7.2.2/docs/migrations/v6-to-v7.md#ibc-module-constants * Add new consensus params keeper * Add consensus keeper to blockers * Fix keeper and module issues in app.go * Add IsSendEnabledCoins and update SetParams interface changes * Fix protobuf build for cosmos 47 (#1800) * fix cp errors by using -f; fix lint by only linting our proto dir; and use proofs.proto directly from ics23 for ibc-go v7 * run proto-all; commit updated third party deps and swagger changes * regenerate proto files * use correct gocosmos build plugin for buf * re-gen all protobuf files to update paths for new gocosmos plugin * update protoc and buf to latest versions * fix staking keeper issues in app.go * update tally handler for gov changes * chain id fix and flag fixes * update deps for cometbft 47.7 upgrade * remove all module legacy queriers * update stakingKeeper to pointer * Replace ModuleCdc from govv1beta1 to govcodec * remove simulations * abci.LastCommitInfo → abci.CommitInfo * Remove unused code in keys.go * simapp.MakeTestEncodingConfig -> moduletestutil.MakeTestEncodingConfi * Fix chain id issues in tests * Fix remaining unit test issues * Update changelog for upgrade * Fix e2e tests using updated kvtool * Update protonet to v47 compatible genesis * Bump cometbft-db to v0.9.1-kava.1 * Update kvtool * Remove extra changelog * Fix merged rocksdb issues * go mod cleanup * Bump cometbft-db to v9 and go to 1.21 * Bump rocksdb version to v8.10.0 * Update kvtool to latest version * Update gin to v1.9.0 * Use ibctm.ModuleName in app_test * Fallback to genesis chain id instead of client toml * Remove all simulations * Fix cdp migrations issue with v47 * Update dependencies to correct tags --------- Co-authored-by: Nick DeLuca <nickdeluca08@gmail.com>
2024-02-06 22:54:10 +00:00
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
tmtime "github.com/cometbft/cometbft/types/time"
2020-04-30 14:23:41 +00:00
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
"github.com/stretchr/testify/suite"
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
2024-05-01 03:17:24 +00:00
"github.com/0glabs/0g-chain/app"
2024-05-01 08:07:32 +00:00
"github.com/0glabs/0g-chain/chaincfg"
2024-05-01 03:17:24 +00:00
"github.com/0glabs/0g-chain/x/bep3/keeper"
"github.com/0glabs/0g-chain/x/bep3/types"
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
)
type GenesisTestSuite struct {
suite.Suite
app app.TestApp
ctx sdk.Context
keeper keeper.Keeper
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
addrs []sdk.AccAddress
}
func (suite *GenesisTestSuite) SetupTest() {
2024-05-01 08:07:32 +00:00
chaincfg.SetSDKConfig()
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
tApp := app.NewTestApp()
suite.ctx = tApp.NewContext(true, tmproto.Header{Height: 1, Time: tmtime.Now()})
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
suite.keeper = tApp.GetBep3Keeper()
suite.app = tApp
_, addrs := app.GeneratePrivKeyAddressPairs(3)
suite.addrs = addrs
}
func (suite *GenesisTestSuite) TestModulePermissionsCheck() {
cdc := suite.app.AppCodec()
testCases := []struct {
name string
permissions []string
expectedPanic string
}{
{"no permissions", []string{}, "bep3 module account does not have burn permissions"},
{"mint permissions", []string{authtypes.Minter}, "bep3 module account does not have burn permissions"},
{"burn permissions", []string{authtypes.Burner}, "bep3 module account does not have mint permissions"},
{"burn and mint permissions", []string{authtypes.Burner, authtypes.Minter}, ""},
{"mint and burn permissions", []string{authtypes.Minter, authtypes.Burner}, ""},
}
for _, tc := range testCases {
suite.Run(tc.name, func() {
suite.SetupTest()
authGenesis := authtypes.NewGenesisState(
authtypes.DefaultParams(),
authtypes.GenesisAccounts{authtypes.NewEmptyModuleAccount(types.ModuleName, tc.permissions...)},
)
bep3Genesis := types.DefaultGenesisState()
genState := app.GenesisState{
authtypes.ModuleName: cdc.MustMarshalJSON(authGenesis),
types.ModuleName: cdc.MustMarshalJSON(&bep3Genesis),
}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
initApp := func() { suite.app.InitializeFromGenesisStates(genState) }
if tc.expectedPanic == "" {
suite.NotPanics(initApp)
} else {
suite.PanicsWithValue(tc.expectedPanic, initApp)
}
})
}
}
func (suite *GenesisTestSuite) TestGenesisState() {
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
type GenState func() app.GenesisState
cdc := suite.app.AppCodec()
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
testCases := []struct {
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
name string
genState GenState
expectPass bool
expectedErr interface{}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
}{
{
name: "default",
genState: func() app.GenesisState {
return NewBep3GenStateMulti(cdc, suite.addrs[0])
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
expectPass: true,
},
{
name: "import atomic swaps and asset supplies",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
_, addrs := app.GeneratePrivKeyAddressPairs(2)
var swaps types.AtomicSwaps
var supplies types.AssetSupplies
for i := 0; i < 2; i++ {
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
swap, supply := loadSwapAndSupply(addrs[i], i)
swaps = append(swaps, swap)
supplies = append(supplies, supply)
}
gs.AtomicSwaps = swaps
gs.Supplies = supplies
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
expectPass: true,
},
{
name: "0 deputy fees",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
gs.Params.AssetParams[0].FixedFee = sdk.ZeroInt()
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
},
expectPass: true,
},
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
{
name: "incoming supply doesn't match amount in incoming atomic swaps",
genState: func() app.GenesisState {
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
gs := baseGenState(suite.addrs[0]) // incoming supply is zero
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
_, addrs := app.GeneratePrivKeyAddressPairs(1)
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
swap, _ := loadSwapAndSupply(addrs[0], 0)
gs.AtomicSwaps = types.AtomicSwaps{swap}
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "asset's incoming supply 0bnb does not match amount 50000 in incoming atomic swaps",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
{
name: "current supply above limit",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
bnbSupplyLimit := math.ZeroInt()
for _, ap := range gs.Params.AssetParams {
if ap.Denom == "bnb" {
bnbSupplyLimit = ap.SupplyLimit.Limit
}
}
gs.Supplies = types.AssetSupplies{
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
types.NewAssetSupply(
c("bnb", 0),
c("bnb", 0),
sdk.NewCoin("bnb", bnbSupplyLimit.Add(i(1))),
c("bnb", 0),
0,
),
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
}
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "asset's current supply 350000000000001bnb is over the supply limit 350000000000000",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
{
name: "incoming supply above limit",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
// Set up overlimit amount
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
bnbSupplyLimit := math.ZeroInt()
for _, ap := range gs.Params.AssetParams {
if ap.Denom == "bnb" {
bnbSupplyLimit = ap.SupplyLimit.Limit
}
}
overLimitAmount := bnbSupplyLimit.Add(i(1))
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
// Set up an atomic swap with amount equal to the currently asset supply
_, addrs := app.GeneratePrivKeyAddressPairs(2)
timestamp := ts(0)
randomNumber, _ := types.GenerateSecureRandomNumber()
randomNumberHash := types.CalculateRandomHash(randomNumber[:], timestamp)
swap := types.NewAtomicSwap(cs(c("bnb", overLimitAmount.Int64())), randomNumberHash,
types.DefaultMinBlockLock, timestamp, suite.addrs[0], addrs[1], TestSenderOtherChain,
TestRecipientOtherChain, 0, types.SWAP_STATUS_OPEN, true, types.SWAP_DIRECTION_INCOMING)
gs.AtomicSwaps = types.AtomicSwaps{swap}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
// Set up asset supply with overlimit current supply
gs.Supplies = types.AssetSupplies{
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
types.NewAssetSupply(
c("bnb", overLimitAmount.Int64()),
c("bnb", 0),
c("bnb", 0),
c("bnb", 0),
0,
),
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
}
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "asset's incoming supply 350000000000001bnb is over the supply limit 350000000000000",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
{
name: "incoming supply + current supply above limit",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
// Set up overlimit amount
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
bnbSupplyLimit := math.ZeroInt()
for _, ap := range gs.Params.AssetParams {
if ap.Denom == "bnb" {
bnbSupplyLimit = ap.SupplyLimit.Limit
}
}
halfLimit := bnbSupplyLimit.Int64() / 2
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
overHalfLimit := halfLimit + 1
// Set up an atomic swap with amount equal to the currently asset supply
_, addrs := app.GeneratePrivKeyAddressPairs(2)
timestamp := ts(0)
randomNumber, _ := types.GenerateSecureRandomNumber()
randomNumberHash := types.CalculateRandomHash(randomNumber[:], timestamp)
swap := types.NewAtomicSwap(cs(c("bnb", halfLimit)), randomNumberHash,
uint64(360), timestamp, suite.addrs[0], addrs[1], TestSenderOtherChain,
TestRecipientOtherChain, 0, types.SWAP_STATUS_OPEN, true, types.SWAP_DIRECTION_INCOMING)
gs.AtomicSwaps = types.AtomicSwaps{swap}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
// Set up asset supply with overlimit supply
gs.Supplies = types.AssetSupplies{
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
types.NewAssetSupply(
c("bnb", halfLimit),
c("bnb", 0),
c("bnb", overHalfLimit),
c("bnb", 0),
0,
),
}
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "asset's incoming supply + current supply 350000000000001bnb is over the supply limit 350000000000000",
},
{
name: "outgoing supply above limit",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
// Set up overlimit amount
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
bnbSupplyLimit := math.ZeroInt()
for _, ap := range gs.Params.AssetParams {
if ap.Denom == "bnb" {
bnbSupplyLimit = ap.SupplyLimit.Limit
}
}
overLimitAmount := bnbSupplyLimit.Add(i(1))
// Set up an atomic swap with amount equal to the currently asset supply
_, addrs := app.GeneratePrivKeyAddressPairs(2)
timestamp := ts(0)
randomNumber, _ := types.GenerateSecureRandomNumber()
randomNumberHash := types.CalculateRandomHash(randomNumber[:], timestamp)
swap := types.NewAtomicSwap(cs(c("bnb", overLimitAmount.Int64())), randomNumberHash,
types.DefaultMinBlockLock, timestamp, addrs[1], suite.addrs[0], TestSenderOtherChain,
TestRecipientOtherChain, 0, types.SWAP_STATUS_OPEN, true, types.SWAP_DIRECTION_OUTGOING)
gs.AtomicSwaps = types.AtomicSwaps{swap}
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
// Set up asset supply with overlimit outgoing supply
gs.Supplies = types.AssetSupplies{
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
types.NewAssetSupply(
c("bnb", 0),
c("bnb", overLimitAmount.Int64()),
c("bnb", 0),
c("bnb", 0),
0,
),
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
}
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "asset's outgoing supply 350000000000001bnb is over the supply limit 350000000000000",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
{
name: "asset supply denom is not a supported asset",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
gs.Supplies = types.AssetSupplies{
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
types.NewAssetSupply(
c("fake", 0),
c("fake", 0),
c("fake", 0),
c("fake", 0),
0,
),
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
}
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "asset's supply limit not found: fake: asset not found",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
{
name: "atomic swap asset type is unsupported",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
_, addrs := app.GeneratePrivKeyAddressPairs(2)
timestamp := ts(0)
randomNumber, _ := types.GenerateSecureRandomNumber()
randomNumberHash := types.CalculateRandomHash(randomNumber[:], timestamp)
swap := types.NewAtomicSwap(cs(c("fake", 500000)), randomNumberHash,
uint64(360), timestamp, suite.addrs[0], addrs[1], TestSenderOtherChain,
TestRecipientOtherChain, 0, types.SWAP_STATUS_OPEN, true, types.SWAP_DIRECTION_INCOMING)
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
gs.AtomicSwaps = types.AtomicSwaps{swap}
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "swap has invalid asset: fake: asset not found",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
{
name: "atomic swap status is invalid",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
_, addrs := app.GeneratePrivKeyAddressPairs(2)
timestamp := ts(0)
randomNumber, _ := types.GenerateSecureRandomNumber()
randomNumberHash := types.CalculateRandomHash(randomNumber[:], timestamp)
swap := types.NewAtomicSwap(cs(c("bnb", 5000)), randomNumberHash,
uint64(360), timestamp, suite.addrs[0], addrs[1], TestSenderOtherChain,
TestRecipientOtherChain, 0, types.SWAP_STATUS_UNSPECIFIED, true, types.SWAP_DIRECTION_INCOMING)
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
gs.AtomicSwaps = types.AtomicSwaps{swap}
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "failed to validate bep3 genesis state: invalid swap status",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
{
name: "minimum block lock cannot be > maximum block lock",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
gs.Params.AssetParams[0].MinBlockLock = 201
gs.Params.AssetParams[0].MaxBlockLock = 200
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "failed to validate bep3 genesis state: asset bnb has minimum block lock > maximum block lock 201 > 200",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
{
name: "empty supported asset denom",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
gs.Params.AssetParams[0].Denom = ""
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "failed to validate bep3 genesis state: asset denom invalid: ",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
{
name: "negative supported asset limit",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
gs.Params.AssetParams[0].SupplyLimit.Limit = i(-100)
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "failed to validate bep3 genesis state: asset bnb has invalid (negative) supply limit: -100",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
{
name: "duplicate supported asset denom",
genState: func() app.GenesisState {
gs := baseGenState(suite.addrs[0])
gs.Params.AssetParams[1].Denom = "bnb"
return app.GenesisState{types.ModuleName: cdc.MustMarshalJSON(&gs)}
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
expectPass: false,
expectedErr: "failed to validate bep3 genesis state: asset bnb cannot have duplicate denom",
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
},
}
for _, tc := range testCases {
suite.Run(tc.name, func() {
suite.SetupTest()
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
gs := tc.genState()
if tc.expectPass {
suite.NotPanics(func() {
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
suite.app.InitializeFromGenesisStates(gs)
}, tc.name)
} else {
feat: upgrade to Cosmos v0.46 (#1477) * Update cosmos-sdk to v0.45.10-kava * Add RegisterNodeService to app * Update cosmos proto files * Update cosmos proto files * Use tagged v0.45.10-kava-v0.19-0.21 cosmos version * update x/auth/legacy to x/auth/migrations * Delete rest packages and registration * Remove rest from proposal handlers * Remove legacy types referencing removed sdk types * Remove legacy tx broadcast handler * Update incentive staking hooks to return error * Remove grpc replace directive, use new grpc version * Fix storetypes import * Update tally_handler with updated gov types * Delete legacy types * Use new gov default config * Update RegisterTendermintService params Signed-off-by: drklee3 <derrick@dlee.dev> * Replace sdk.StoreKey with storetypes.StoreKey * Replace sdk.Int#ToDec with sdk.NewDecFromInt * Replace sdk.NewUintFromBigInt with sdkmath.NewUintFromBigInt Signed-off-by: drklee3 <derrick@dlee.dev> * Update most intances of govtypes to govv1beta1 * Unpack coin slice for Coins#Sub and Coins#SafeSub Signed-off-by: drklee3 <derrick@dlee.dev> * Update committee gov codec registration Signed-off-by: drklee3 <derrick@dlee.dev> * Update migrate utils period_vesting Coins#Sub Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub in community proposal handler Signed-off-by: drklee3 <derrick@dlee.dev> * Update Coin#Sub, FundModuleAccount/FundAccount in banktestutil Signed-off-by: drklee3 <derrick@dlee.dev> * Update community, earn, kavadist proposal gov registration * Update evm cli client EthSecp256k1Type check * AccAddressFromHex to AccAddressFromHexUnsafe * Add mint DefaultInflationCalculationFn to earn test * Update use of removed staking.NewHandler * Rename FlagIAVLFastNode -> FlagDisableIAVLFastNode * cmd: Update new snapshot app option Signed-off-by: drklee3 <derrick@dlee.dev> * cmd: Add tendermint default config, use cosmos rpc status command Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint import path github.com/tharsis/ethermint -> github.com/evmos/ethermint * Upgrade ibc-go to v6 * Update proto dependencies Signed-off-by: drklee3 <derrick@dlee.dev> * Update Tally handler test with new gov types * Update helpers.GenTx -> helpers.GenSignedMockTx * Update evmkeeper.NewKeeper params Signed-off-by: drklee3 <derrick@dlee.dev> * Update ante authz, tests * Add feemarket transient key, pass subspaces to evm/feemarket keepers * Update new ante decorators * Add new addModuleInitFlags to server commands * Pass codec to keyring.New in genaccounts * Pass codec to client keys add * Add SendCoins to evmutil bank_keeper * Use github.com/cosmos/iavl@v0.19.5 * Add ante HandlerOptions * Add unimplemented SendCoins to evmutil bank keeper Ethermint x/evm does not use this method * Update init-new-chain script to disable post-london blocks * Modify test genesis states to append 1 validator * Update tally handler test to use string values * Prevent querying balance for empty sdk.AccAddress in auction bidding test * Set default bond denom to ukava * Remove overwritten bank genesis total supply in committee proposal test Signed-off-by: drklee3 <derrick@dlee.dev> * Use ukava for testing staked balance * Disable minting in community proposal handler test Previously stake denom is used, which resulted in 0 minted coins * Update hard APYToSPY test expected value Increased iterations in sdk.ApproxRoot, updated closer to real value * Fix NewDecCoinsFromCoins bug in incentive collectDerivativeStakingRewards * Allow bkava earn incentive test values to match within small margin for rounding Signed-off-by: drklee3 <derrick@dlee.dev> * Update invalid denom in issuance message coin validation Colons are now valid in denoms Signed-off-by: drklee3 <derrick@dlee.dev> * Remove genesis validator in incentive delegation tests * Update pricefeed market test for invalid denom Signed-off-by: drklee3 <derrick@dlee.dev> * Update incentive delegator rewards test without genesis validator Signed-off-by: drklee3 <derrick@dlee.dev> * Add validator to export test * Clear bank state in minting tests Signed-off-by: drklee3 <derrick@dlee.dev> * Remove validator for no stake tally test Signed-off-by: drklee3 <derrick@dlee.dev> * Clear incentive state before InitGenesis in incentive genesis export test * Update swagger Signed-off-by: drklee3 <derrick@dlee.dev> * Update ethermint version to match replaced version * Remove legacy swagger * Add NewEthEmitEventDecorator * Remove redundant func for AddModuleInitFlags * Remove unused addBankBalanceForAddress func * Add SetIAVLLazyLoading option to app cmd * Use legacy.RegisterAminoMsg for committee msg concrete registration * Remove unnecessary Amino field * Add evm_util bankkeeper SendCoins comment * Update test method ResetBankState to DeleteGenesisValidatorCoins to be more clear * Validate incentive params.RewardsPerSecond to be non-zero * Validate swap pools to disallow colons in token denoms * Register all legacy amino types on gov modulecdc * Remove redundant Comittee interface registration * Pin goleveldb to v1.0.1-0.20210819022825-2ae1ddf74ef7 Causes failed to load state at height errors * Update ethermint to new pinned version with minGasPrices parse error fix * Update cosmos fork dependcy commit to include reverted account constructor patch * Update Cosmos v0.46.11 and cometbft v0.34.27 * Bump minimum go version to 1.19 * Update tendermint proto * Update internal testnet genesis * Move NewCanTransferDecorator before NewEthGasConsumeDecorator * Add hard borrow store tests (#1514) * add store tests for Borrow type * refactor Deposit tests to match * Fix old bep3 tests (#1515) * Update Ethermint to 1b17445 to fix duplicate proto registration * Add custom status command to use snake_case and stdout * Add SetInflation helper * Reduce ambiguity with evm CanSignEthTx error * Remove init genesis validator claim in test * Add disabled evmante.NewMinGasPriceDecorator with x/feemarket note * chore: use tagged versions for Cosmos and Ethermint forks * update kvtool & increase wait for ibc transfer test --------- Signed-off-by: drklee3 <derrick@dlee.dev> Co-authored-by: Ruaridh <rhuairahrighairidh@users.noreply.github.com> Co-authored-by: Robert Pirtle <astropirtle@gmail.com>
2023-04-04 00:08:45 +00:00
suite.PanicsWithValue(tc.expectedErr, func() {
suite.app.InitializeFromGenesisStates(gs)
}, tc.name)
}
})
[R4R] Testnet-5k proposal (#404) * R4R: BEP3 module (#370) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * Automatically update fees for risky cdps (#381) * wip: sketch implementation * adding initial function to calcuate risky fees for cdps * adding todo comment to fix the function arguments * changing the function arguments * adding multiplication, print error, change types * get the number of periods, add comments and questios for code review * adding specification notes * removing old comment * replace collateral with collateral denom * remove todo and clarify comment * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update go.sum Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/abci.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * updating fees * error handling and propogation * fix collat denom variable * fix build issues, error, variable names, parameter type * Update x/cdp/abci.go Use `err` as name instead of `e` Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/keeper/fees.go Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * fixing error variable name * changing call to method to compute risky cdps fees * changing the calcualation to select risky cdps to be based on normalized ratio * adding skeleton for test methods, adding skeleton helper function for creating cdps for use in tests * fixing function call to helper method * fix assignment, calling function that returns two variables instead of one * adding comment and fixing call to create cdps * adding create cdps function and updating / fixing the test. one of the expected tests is failing, need to figure out why that is. added a todo question to note it * logging the cdp object before and after updating. it seems that the fees are not set / written before or after * adding interim changed * updated * fixing normalized ratio * code cleanup * changing print of accumulated fees * removing debug code * remove completed todo * remove old variable * remove spewing print statement * remove dead todo * adding note about prices for future * remove dead code * try to fix test * fix types * fix types * fix context in call * changing back as new version breaks a test * fix * cleanup, removing logging and old code * remove dead code * removing changes to cdp test * Update x/cdp/keeper/fees.go Remove old comment as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update x/cdp/spec/04_begin_block.md Fix typo as suggested Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * Add Savings Rate (#365) * fix: ensure cdp module accounts created at gensis * feat: add savings rate * chore: update alias * fix: update default test param values * chore: update spec for savings rate * fix: add distribution time to genesis state * fix: iterate over accounts using callback function * feat: use seprate mod account for savings rate * fix: remove mod account coins from total supply * address review comments * fix: genesis function initialization * fix: update alias * add comment about maintaining module account list * feat: add genesis example * R4R: bep3 module upgrades (#388) * bep3 module scaffold from cosmos/scaffold * Populated types, keeper with HTLT msgs, module params, and scaffolding for keys, and genesis * added KavaHTLT struct, UpdateHTLT struct, resolved compilation errors * refactored kavaHTLT struct <-> msgs * Implemented params, refactored UpdateKavaHTLT to UpdateKHTLT interface * Updated keeper with byTimeIndex methods * HTLT creation flow * adjustments in prep for repo config updates * App moudle updated for bep3, MsgCreateHTLT tested, HTLT keeper methods tested * Updated bep3 params to match spec * tests for MsgRefundHTLT, MsgDepositHTLT, MsgClaimHTLT * AddHtlt cli cmd, queryHtlts cmd, added conversion funcs for binance -> cosmos types, refactored MsgCreateHTLT from binance.AccAddress to sdk.AccAddress * working edits related to bep3-deputy compatibility * removed binance-chain go sdk dependency * updated msg ValidateBasic() return to sdk.Error type * implement MsgCalculateSwapID * added MsgCalculateSwapID test, updated randomNumberHash type to []byte * removed binance type conversions * msg codec registration * clean /types directory * CLI cmds:create htlt, query htlt * update keeper logic * handle MsgCreateHTLT * implement htlt type, msg types * implement global chain types * update querier * added go-ethereum to go mod * refactor QuerySwap to QueryHTLT * update HTLTMsg to MsgCreateHTLT * implemented htlt deposit * add token transfer to MsgCreateHTLT * implement refund, claim client txs * add refund/claim cmds to tx cmd * commiting go.sum for build * implemented keeper claim logic * add RandomNumberHash to create-htlt event * implement refund keeper logic * AddHTLT updated to CreateHTLT * added params keeper * updated params to single chain, added sample genesis file * implemented htlt keeper param checks * removed go-ethereum dependency * updated go.sum * housekeeping on keeper tests * updated cli tx cmds * ran go.tidy * remove links from module readme * updated coin construction in tests * added expectedIncome checks in ValidateBasic() * made ValidateAsset() more robust * update param format for tests * added basic HTLTByTime index * implement abci, fix expectedIncome validation * byTime index updated to blocks, added swap ID & expiration block to htlt * added not-expired check to HTLT claims * cross-chain mint/burn logic, htlt string type refactored to []byte * fix bnb_deputy_address param * remove abci panic * cmn.HexBytes, byTime index iteration update, claim-mint logic update * update genesis example * general codebase cleaning * renamed HTLT to AtomicSwap * staging for PR * updated naming conventions * refactor + revisions * removed code related to deposits & swap block index * added timestamp validation comment * post-refactor housekeeping * post refactor housekeeping (keeper) * remove GenesisAtomicSwap type * refactor asset supply logic * BeginBlocker expires swaps automatically * param asset.limit type updated to sdk.Int * remove claimed swaps from block index * fix DefaultDeputyAddress * removed BaseSwap * revisions * total genesis coins * updated tx examples * timestamp to unix * add past timestamp limit * update random number byte encoding * add recipient_other_chain to AtomicSwap * add TODO for timestamp arg parsing * generate secure random numbers * update tx cli * keeper tests * add bnb token * bep3 params test set up, test CreateAtomicSwap * swap table tests * Revert "bep3 params test set up, test CreateAtomicSwap" This reverts commits containing tests. * use tmtime.Now() * Kava distribution module (#387) * wip: kavadist module structure * feat: implement minting logic * wip: sketch module * wip: module level code * wip: bug fixes * wip: add tests * wip: resolve todos and tidy * fix: remove unused file * address review comments * fix: update genesis for guide (#394) * add kava_dist to sample genesis file (#396) * R4R: BEP3 module test suite (#395) * refactor secure rng * refactor common tests, implement keeper tests * implement asset tests * implement params, querier tests * implement keeper swap tests * refactor import naming conventions * implement core types tests * improve keeper swap tests * implement genesis types test * implement params test + revisions * implement duplicate swap test * implement duplicate swap ID test * R4R: BEP3 additional features + module test suite (#397) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * Swagger Rest Automating Testing With Dredd (#390) * swagger testing and mods * fixed a test * fixed withdraw address * adding script to start the chain * fixed val rewards test * fix outstanding rewards test * fixed rewards * hooks skeleton * adding test file and hooks * updates on the hooks working * now creates a transaction and sends to the chain via rest api successfully * small fix - now works * 34 tests now passing successfully * fix print statement error * instructions on how to run the tests * changing function names when to run the hooks * adding instructions on how to setup and run the dredd tests * removing large error output file * removing binary file * removing more output logging files * creating a vote on a proposal to send to the blockchain * adding instructions on how to setup chain * adding function to get account number and sequence number * adding send msg to blockchain method * posting vote tx to blockchain - successfully prepares and sends vote to endpoint but endpoint returns 'inactive proposal with id' * successfully depositing 600 stake to a proposal * successfully depositing onto a proposal and then voting on it * got another governance test working now after submitting a vote to the blockchain * updating instructions on how to run * fixed another voting test * fixed deposits test * fixed another gov test * fix print line * fix circle ci build issue with println * improving instructions on how to build and run the hooks and dredd tests * improving instructions on how to build and run the hooks and dredd tests * finally fixed param change governance proposal test * trying to unskip tests wip * fixed gov/proposals test * fixed another test * fixed a slashing test * fixed another redelegation test * fixed another unbonding delegation test * fixed more staking tests * fixed another staking test * fixed another test * fixed more tests. 50 now passing, 15 failing * fixed mislabeled variable * managed to fix unjail test * fixed bank acct transfers test * change certain types from number to string to match the output, typo fix * another typo fix * fixed delegation test * finally figured out and fixed the latest blocks types mismatch - fixed the test * fixed staking delegators validators test * removed and noted unimplemented tests from yaml file. fixed blocks height test * fixed transcations test * adding functionality to send transfer of coins to blockchain, and to send delegations * updating the yaml to line up with a valid message format * added delegation method * adding test results showing 57 are now passing and only 5 failing * remove test yaml file from pull req * testing file updates * adding test memo * added undelegation hook method - fixed unbonding delegation test * fixed the get tx from hash test * adding not if you encounter validator set is different errors how to fix. 59 tests now passsing, 3 failing * adding test results showing 59 passing, 3 failing * finally fixed encode test - 60 tests now passing only 2 failing * adding test results 60 passing 1 failing * more test updates * finally fixed decode test - 61 tests now passing only 1 failing * test results 61 tests passing 1 failing * remove dead code * all 62 tests are now passingga swagger.yaml 0 failing * used for testing and generating transactions and testing hooks * updating run instructions * more instructions updates * updating the test file * adding note on reading from a file * refactoring code and cleanup * refactoring getting the keybase * code cleanup for address, keyname methods, remove unused code * more code cleanup around addresses * updating the instructions on how to run the dredd tests * adding comment * adding additional requirements to the go.mod dependency file * remove hardcoded home directory, read using os golang library * increase timeout in example run script * remove hardcoded home directory * reordering commands to get rid of errors if key directory is deleted * changing to use temporary directory * updating dredd timeout time * finally managed to get the script wroking using a temporary directory instead of the default * adding notes and comments * changing to use a temp directory instead of default directory * remove un-needed file * rename debugging tools folder * adding instructions to install dredd and npm * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * Update swagger-ui/startchain.sh Send output to dev null not to console Co-Authored-By: Kevin Davis <karzak@users.noreply.github.com> * adding new version of test.go to setup the chain * adding todo to update instructions for new workflow * updating script to start and setup the chain * updating the transaction hash test * update the start chain script to setup the chain correctly * add the script to stop the chain and the rest server * updated the instructions for the new workflow so that all the tests pass the first time * updated the instructions on how to run the tests * update instructions for printing logs or not * updating the startchain script to add messages when starting the rest server and preparing transactions * adding print messages when stop chain is completed * updating test results to just include test output and not the debug log statements * cleaning up the messages that are printed to the user * moving files to their own directory * build go test file and remove previous binary * move instructions * updating instructions now that test file is auto built * building, running dredd tests, propagating error code, shut down blockchain all in one script * fix object type to array type for block latests * cleaning up the script * rename script as it now does all the setup, test running, shutdown, and cleanup * update instructions for new workflow * adding a shell script to call from the makefile * adding a make command to build and run all the dredd tests * update instructions to run using make * updated code review comment * minor update to instructions * update remove file command so doesn't print an error if the file has already been deleted * renaming folder and test * adjust code comment * removing example test results * updating instructions to remove reference to the test results * remove old hooks file * remove obsolete code comment * remove swagger file, will change references to the other one * remove shell script, will now use the one called from make instead * renaming as underscore messes up go build * clean up script, fix return code issues * cleanup output file * fix object to array issue * add comments to explain functionality * use variables for kvd home and kvcli home, check for errors * change the kvcli home directory. need to take this from command line * take kvcli from command line parameter to golang file * take kvcli directory from command line parameter Co-authored-by: John Maheswaran <john@kava.io> Co-authored-by: Kevin Davis <karzak@users.noreply.github.com> * R4R: Update BEP3 rest endpoints + format example requests (#402) * update and reorder errors * implement swap deletion block delay * add swap deletion block delay, set up tests * add secure random number gen * implement AtomicSwapLongtermStorage index * fix syntax error * abci test updates * implement handler test * implement core genesis tests * update asset supply logic * implement functional asset supply * pretty print atomic swaps * requested revisions * fix test suite post merge * implement and integrate asset supply tests * update import genesis, add storage duration param * implement swap deletion ABCI test * go mod tidy * remove duplicated interface assertion * add new bep3 param to contrib genesis file * remove btc from supported assets * revisions: LongtermStorageDuration param * revisions: suite ctx, fix genesis, update contrib * implement AssetSupply type, store key, keeper * integrate supply and swaps; genesis, tests * remove legacy comments * requested revisions * update alias * rest queries * implement BEP3 REST txs * draft rest server readme + example json files * tested all swap rest examples * implement query swaps rest endpoint * feat: update genesis examples * fix: use post instead of put (#405) Co-authored-by: Denali Marsh <denali@kava.io> Co-authored-by: John Maheswaran <jmaheswaran@users.noreply.github.com> Co-authored-by: John Maheswaran <john@kava.io>
2020-03-28 02:54:00 +00:00
}
}
func TestGenesisTestSuite(t *testing.T) {
suite.Run(t, new(GenesisTestSuite))
}