-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
venkatesh
authored and
venkatesh
committed
Sep 5, 2021
1 parent
693bc30
commit 991f010
Showing
10 changed files
with
1,444 additions
and
391 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package types | ||
|
||
import ( | ||
bandprice "github.com/InjectiveLabs/sdk-go/bandchain/hooks/price" | ||
bandobi "github.com/bandprotocol/bandchain-packet/obi" | ||
bandPacket "github.com/bandprotocol/bandchain-packet/packet" | ||
) | ||
|
||
func NewOracleRequestPacketData(clientID string, calldata []byte, r *BandOracleRequest) bandPacket.OracleRequestPacketData { | ||
return bandPacket.OracleRequestPacketData{ | ||
ClientID: clientID, | ||
OracleScriptID: uint64(r.OracleScriptId), | ||
Calldata: calldata, | ||
AskCount: r.AskCount, | ||
MinCount: r.MinCount, | ||
FeeLimit: r.FeeLimit, | ||
PrepareGas: r.PrepareGas, | ||
ExecuteGas: r.ExecuteGas, | ||
} | ||
} | ||
|
||
// GetCalldata gets the Band IBC request call data based on the symbols and multiplier. | ||
func (r *BandOracleRequest) GetCalldata() []byte { | ||
|
||
requestCallData := bandprice.Input{ | ||
Symbols: r.Symbols, | ||
Multiplier: BandPriceMultiplier, | ||
} | ||
|
||
callData := bandobi.MustEncode(requestCallData) | ||
|
||
return callData | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.