Skip to content

Commit 4fc8c74

Browse files
committed
fix(x/oracle): update validate params
Signed-off-by: Artur Troian <troian@users.noreply.github.com>
1 parent ef200a4 commit 4fc8c74

5 files changed

Lines changed: 36 additions & 5 deletions

File tree

_run/common.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ node-init-genesis:
8484
$(AKASH) genesis init node0
8585
cp "$(GENESIS_PATH)" "$(GENESIS_PATH).orig"
8686
cat "$(GENESIS_PATH).orig" | \
87-
jq -M '.app_state.gov.voting_params.voting_period = "30s"' | \
87+
jq -M '.app_state.gov.voting_params.voting_period = "60s"' | \
88+
jq -M '.app_state.gov.params.voting_period = "60s"' | \
89+
jq -M '.app_state.gov.params.expedited_voting_period = "30s"' | \
90+
jq -M '.app_state.gov.params.max_deposit_period = "60s"' | \
8891
jq -rM '(..|objects|select(has("denom"))).denom |= "$(CHAIN_TOKEN_DENOM)"' | \
8992
jq -rM '(..|objects|select(has("bond_denom"))).bond_denom |= "$(CHAIN_TOKEN_DENOM)"' | \
9093
jq -rM '(..|objects|select(has("mint_denom"))).mint_denom |= "$(CHAIN_TOKEN_DENOM)"' > \

_run/node/prop.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"messages": [
3+
{
4+
"@type": "/akash.oracle.v1.MsgUpdateParams",
5+
"authority": "akash10d07y265gmmuvt4z0w9aw880jnsr700jhe7z0f",
6+
"params": {
7+
"sources": [
8+
"akash1yd535w6kyzlwjrj0zzf2vxqwpd5mx4m88xjmtf"
9+
],
10+
"min_price_sources": 0,
11+
"max_price_staleness_blocks": "0",
12+
"twap_window": "0",
13+
"max_price_deviation_bps": "0",
14+
"feed_contracts_params": [
15+
{
16+
"@type": "/akash.oracle.v1.PythContractParams",
17+
"akt_price_feed_id": "0x1c5d745dc0e0c8a0034b6c3d3a8e5d34e4e9b79c9ab2f4b3e6a8e7f0c9e8a5b4"
18+
}
19+
]
20+
}
21+
}
22+
],
23+
"deposit": "50000000uakt",
24+
"title": "Add Oracle Price Feeder Source",
25+
"summary": "Authorize price feeder address for AKT/USD oracle",
26+
"expedited": true
27+
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ require (
4747
google.golang.org/grpc v1.76.0
4848
gopkg.in/yaml.v3 v3.0.1
4949
gotest.tools/v3 v3.5.2
50-
pkg.akt.dev/go v0.2.0-b3
50+
pkg.akt.dev/go v0.2.0-b4
5151
pkg.akt.dev/go/cli v0.2.0-b3
5252
pkg.akt.dev/go/sdl v0.2.0-b0
5353
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3290,8 +3290,8 @@ nhooyr.io/websocket v1.8.17 h1:KEVeLJkUywCKVsnLIDlD/5gtayKp8VoCkksHCGGfT9Y=
32903290
nhooyr.io/websocket v1.8.17/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c=
32913291
pgregory.net/rapid v0.5.5 h1:jkgx1TjbQPD/feRoK+S/mXw9e1uj6WilpHrXJowi6oA=
32923292
pgregory.net/rapid v0.5.5/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04=
3293-
pkg.akt.dev/go v0.2.0-b3 h1:RfISt4pDfOl5pDfwMyWRmDMdLptP/sU1Zyfsqf1YHeY=
3294-
pkg.akt.dev/go v0.2.0-b3/go.mod h1:8cUJoOmylVh0+UGtr0uY5bOvfIZiir1X6iDelXqxv9M=
3293+
pkg.akt.dev/go v0.2.0-b4 h1:LL8qCnnTkmJFyIt+STDuf0i3R5DIc4ZTPM4CYivltik=
3294+
pkg.akt.dev/go v0.2.0-b4/go.mod h1:8cUJoOmylVh0+UGtr0uY5bOvfIZiir1X6iDelXqxv9M=
32953295
pkg.akt.dev/go/cli v0.2.0-b3 h1:z7v0ce53m/Yv0xMC080kgwwsgXrGA3hY2oVZTQrTv1s=
32963296
pkg.akt.dev/go/cli v0.2.0-b3/go.mod h1:L+jzPE95i0YQvuEgSDi5WlVeaSe5FpocofH+k4akNio=
32973297
pkg.akt.dev/go/sdl v0.2.0-b0 h1:IOx8FwA57r08fiuTmWNmuTVpQhzb7vGPuCPhMtxi0fo=

x/oracle/keeper/keeper.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ func NewKeeper(cdc codec.BinaryCodec, skey *storetypes.KVStoreKey, authority str
8989
if err != nil {
9090
panic(err)
9191
}
92+
9293
k.Schema = schema
9394

9495
return k
@@ -412,7 +413,7 @@ func (k *keeper) getTWAPHistory(ctx sdk.Context, source uint32, denom string, st
412413

413414
// SetParams sets the x/oracle module parameters.
414415
func (k *keeper) SetParams(ctx sdk.Context, p types.Params) error {
415-
if err := p.Validate(); err != nil {
416+
if err := p.ValidateBasic(); err != nil {
416417
return err
417418
}
418419

0 commit comments

Comments
 (0)