-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: asset pair refactor and tests for testutil/testapp (#653)
* feat: governance proposal type for adding oracles * govclient handler and cli command #wip * govclient handler and cli command #wip * test(pricefeed): TestAddOracleProposalFromJson * linter + cleanup * register codec for govtype * cli(pricefeed): proposal initialization with cli command #wip * debug(cli_test.go) #wip * debug cli #wip * add flag from * test(pricefeed): TestWhitelistOraclesForPairs * (pricefeed): proto and types changes * (common): Make AssetPair a proto type; write Validate methods and new utilities * refactor: update whitelist functions. (2) Create KV store for oracles and active pairs #wip * fix(pricefeed) #wip * fix,feat(pricefeed): SetMany. (2) Fix keeper_test.go * refactor: Group and refactor grpc_query price files * more fixes and quality improvements * fix: expected keepers interfaces for pricefeed * fix: get compilation and linter passing. Tests are #wip * fix,tests(pricefeed): keeper_test, params_test passing; coverage increased to 75% #wip * test(pricefeed/keeper): all keeper tests passing after refactor * fix: corrected stablecoin and pricefeed following asset pair changes * fix(common) * test(pricefeed): Short tests passing; stablecoin and perp are #wip * fix(stablecoin): abci_test.go fixed * fix(perp,vpool): refactor functions to use the proto AssetPair * fix: Change references to AssetPair.String to use AsString * fix(ibc_test.go): Use asset pair proto * test: all integration tests passing * refactor: improve variable names for codec.ProtoMarshalers and add comments * refactor: Clean up AssetPair and AssetPairs to function like sdk.Coin and sdk.Coins * refactor: move http and rest logic from gov_client.go to rest.go * finish leftover TODO items; add comments * refactor: AsString -> String using option (gogoproto.goproto_stringer_all) = false * refactor: Make common pairs for ETH and BTC. Replace UST with USDC. * feat(pricefeed): Replace GetAuthorizedAddresses with GetOraclesForPairs * (app):register proposal handler in govRouter * (cli_test.go): Verify AddOracle txResp validity and query proposal status * prepend rpc query methods with 'Query' * (cli_test.go): Move proposal to vote status by meeting min deposit * refactor: remove AssetPair.Name function * linter * refactor: use common.AssetPair proto type in the pricefeed params * refactor: Return oraclesMap from GetOraclesForPairs * add pricefeedcli.AddOracleProposalHandler to gov app.ModuleBasics * refactor: Remove AddOracleProposalWithDeposit and use govcli flag instead. 2. Use AssetPair for PostPrice * fix #wip resolve wiring and cli test flags inconsistency * feat(testutil/testapp): Utility for initializing network with configurable genesis * refactor: standardize testapp imports * fix(pricefeed): Tests passing with accepted governance vote 20 sec vote time * test(pricefeed/.../cli_test): Finish query TODOs in CmdAddOracleProposal * fix(rest.go): Proposer field was not populated during rest handler * fix: Remove CmdAddOracleProposal from pricefeed tx command * refactor: strip away governance proposal logic and wiring * refactor(testutil/testapp): Add comments and cleanup unused code * removed: remainder of add oracle proposal wiring * changes to address PR #653 comments Co-authored-by: Agent Smith <[email protected]>
- Loading branch information
1 parent
28e50de
commit 4b68e2c
Showing
143 changed files
with
3,674 additions
and
2,817 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
syntax = "proto3"; | ||
|
||
package nibiru.common; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/NibiruChain/nibiru/x/common"; | ||
|
||
option (gogoproto.equal_all) = true; | ||
option (gogoproto.verbose_equal_all) = true; | ||
option (gogoproto.goproto_stringer_all) = false; | ||
|
||
message AssetPair { | ||
option (gogoproto.goproto_getters) = false; | ||
string token0 = 1; | ||
string token1 = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package common | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
func AddrsToStrings(addrs ...sdk.AccAddress) []string { | ||
var addrStrings []string | ||
for _, addr := range addrs { | ||
addrStrings = append(addrStrings, addr.String()) | ||
} | ||
return addrStrings | ||
} | ||
|
||
func StringsToAddrs(strs ...string) []sdk.AccAddress { | ||
var addrs []sdk.AccAddress | ||
for _, str := range strs { | ||
addr := sdk.MustAccAddressFromBech32(str) | ||
addrs = append(addrs, addr) | ||
} | ||
return addrs | ||
} |
Oops, something went wrong.