-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] feat: add price oracle module #6
Conversation
var key []byte | ||
|
||
tokenIdBytes := make([]byte, 4) | ||
binary.BigEndian.PutUint32(tokenIdBytes, uint32(tokenId)) |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
x/oracle/keeper/types.go
Outdated
|
||
func (p *params) getTokenFeeder(feederId int32) *types.TokenFeeder { | ||
for k, v := range p.TokenFeeders { | ||
if int32(k) == feederId { |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
) | ||
|
||
var ( | ||
DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) |
Check failure
Code scanning / gosec
Potential integer overflow by integer type conversion
package oracle | ||
|
||
import ( | ||
"math/rand" |
Check failure
Code scanning / gosec
Blocklisted import runtime
|
||
// String implements the Stringer interface. | ||
func (p Params) String() string { | ||
out, _ := yaml.Marshal(p) |
Check warning
Code scanning / gosec
Returned error is not propagated up the stack.
|
||
// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module | ||
func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { | ||
types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) |
Check warning
Code scanning / gosec
Errors unhandled.
b := store.Get(types.PricesRoundKey(nextRoundId - 1)) | ||
if b != nil { | ||
//should always be true | ||
k.cdc.Unmarshal(b, &price) |
Check warning
Code scanning / gosec
Errors unhandled.
return | ||
} | ||
|
||
k.cdc.Unmarshal(b, &price) |
Check warning
Code scanning / gosec
Errors unhandled.
for k := range m.Onchain { | ||
v := m.Onchain[k] | ||
baseI := i | ||
i -= len(v) | ||
copy(dAtA[i:], v) | ||
i = encodeVarintInfo(dAtA, i, uint64(len(v))) | ||
i-- | ||
dAtA[i] = 0x12 | ||
i = encodeVarintInfo(dAtA, i, uint64(k)) | ||
i-- | ||
dAtA[i] = 0x8 | ||
i = encodeVarintInfo(dAtA, i, uint64(baseI-i)) | ||
i-- | ||
dAtA[i] = 0x12 | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map
for k := range m.Offchain { | ||
v := m.Offchain[k] | ||
baseI := i | ||
i -= len(v) | ||
copy(dAtA[i:], v) | ||
i = encodeVarintInfo(dAtA, i, uint64(len(v))) | ||
i-- | ||
dAtA[i] = 0x12 | ||
i = encodeVarintInfo(dAtA, i, uint64(k)) | ||
i-- | ||
dAtA[i] = 0x8 | ||
i = encodeVarintInfo(dAtA, i, uint64(baseI-i)) | ||
i-- | ||
dAtA[i] = 0xa | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map
for k, v := range m.Offchain { | ||
_ = k | ||
_ = v | ||
mapEntrySize := 1 + sovInfo(uint64(k)) + 1 + len(v) + sovInfo(uint64(len(v))) | ||
n += mapEntrySize + 1 + sovInfo(uint64(mapEntrySize)) | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map
for k, v := range m.Onchain { | ||
_ = k | ||
_ = v | ||
mapEntrySize := 1 + sovInfo(uint64(k)) + 1 + len(v) + sovInfo(uint64(len(v))) | ||
n += mapEntrySize + 1 + sovInfo(uint64(mapEntrySize)) | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map
package nullify | ||
|
||
import ( | ||
"reflect" |
Check notice
Code scanning / CodeQL
Sensitive package import
|
||
import ( | ||
"reflect" | ||
"unsafe" |
Check notice
Code scanning / CodeQL
Sensitive package import
opWeightMsgCreatePrice, | ||
defaultWeightMsgCreatePrice, | ||
func(r *rand.Rand, ctx sdk.Context, accs []simtypes.Account) sdk.Msg { | ||
oraclesimulation.SimulateMsgCreatePrice(am.accountKeeper, am.bankKeeper, am.keeper) |
Check warning
Code scanning / CodeQL
Expression has no effect
…lated data in keeper
dd846cf
to
7a228f0
Compare
Description
This is currently a WIP pr to track the process, The code is undergoing rapid development, with the possibility of frequent and substantial changes.
task list:
This version has implemented logics and rules that are compatible with v2, so a hard fork might not be needed to upgrade to V2.
Rationale
N/A
Example
N/A
Changes
N/A