forked from DongCoNY/research-cosmos
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request DongCoNY#9 from onomyprotocol/nhan/oracle_module
[Feature] Add `Oracle module`
- Loading branch information
Showing
85 changed files
with
19,269 additions
and
550 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
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,56 @@ | ||
package app | ||
|
||
// import ( | ||
// storetypes "cosmossdk.io/store/types" | ||
// oraclekeeper "github.com/onomyprotocol/reserve/x/oracle/keeper" | ||
// oraclemodule "github.com/onomyprotocol/reserve/x/oracle/module" | ||
// oracletypes "github.com/onomyprotocol/reserve/x/oracle/types" | ||
// "github.com/cosmos/cosmos-sdk/runtime" | ||
// authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" | ||
// ibcfee "github.com/cosmos/ibc-go/v8/modules/apps/29-fee" | ||
// porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" | ||
// ) | ||
|
||
// // registerOracleModule register Oracle keepers and non dependency inject modules. | ||
// func (app *App) registerOracleModule() (porttypes.IBCModule, error) { | ||
// // set up non depinject support modules store keys | ||
// if err := app.RegisterStores( | ||
// storetypes.NewKVStoreKey(oracletypes.StoreKey), | ||
// ); err != nil { | ||
// panic(err) | ||
// } | ||
|
||
// // register the key tables for legacy param subspaces | ||
// app.ParamsKeeper.Subspace(oracletypes.ModuleName).WithKeyTable(oracletypes.ParamKeyTable()) | ||
// // add capability keeper and ScopeToModule for oracle ibc module | ||
// scopedOralceKeeper := app.CapabilityKeeper.ScopeToModule(oracletypes.ModuleName) | ||
|
||
// app.OracleKeeper = oraclekeeper.NewKeeper( | ||
// app.AppCodec(), | ||
// runtime.NewKVStoreService(app.GetKey(oracletypes.StoreKey)), | ||
// app.Logger(), | ||
// authtypes.NewModuleAddress(oracletypes.ModuleName).String(), | ||
// app.GetIBCKeeper, | ||
// scopedOralceKeeper, | ||
// ) | ||
|
||
// // register IBC modules | ||
// if err := app.RegisterModules( | ||
// oraclemodule.NewAppModule( | ||
// app.AppCodec(), | ||
// app.OracleKeeper, | ||
// app.AccountKeeper, | ||
// app.BankKeeper, | ||
// )); err != nil { | ||
// return nil, err | ||
// } | ||
|
||
// app.ScopedOracleKeeper = scopedOralceKeeper | ||
|
||
// // Create fee enabled ibc stack for oracel | ||
// var oracleStack porttypes.IBCModule | ||
// oracleStack = oraclemodule.NewIBCModule(app.OracleKeeper) | ||
// oracleStack = ibcfee.NewIBCMiddleware(oracleStack, app.IBCFeeKeeper) | ||
|
||
// return oracleStack, nil | ||
// } |
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,30 @@ | ||
syntax = "proto3"; | ||
package reserve.oracle; | ||
|
||
import "gogoproto/gogo.proto"; | ||
|
||
option go_package = "github.com/onomyprotocol/reserve/x/oracle/types"; | ||
|
||
message EventBandAckSuccess { | ||
string ack_result = 1; | ||
int64 client_id = 2; | ||
} | ||
|
||
message EventBandAckError { | ||
string ack_error = 1; | ||
int64 client_id = 2; | ||
} | ||
|
||
message EventBandResponseTimeout { int64 client_id = 1; } | ||
|
||
message SetBandPriceEvent { | ||
string relayer = 1; | ||
repeated string symbols = 2; | ||
repeated string prices = 3 [ | ||
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec", | ||
(gogoproto.nullable) = false | ||
]; | ||
uint64 resolve_time = 4; | ||
uint64 request_id = 5; | ||
int64 client_id = 6; | ||
} |
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
Oops, something went wrong.