11import * as assert from "assert" ;
22
3- import { getDevnetApi , getRandomSubstrateKeypair } from "../src/substrate"
3+ import { getAliceSigner , getDevnetApi , getRandomSubstrateKeypair , waitForTransactionWithRetry } from "../src/substrate"
44import { devnet } from "@polkadot-api/descriptors"
55import { TypedApi } from "polkadot-api" ;
66import { convertH160ToSS58 , convertPublicKeyToSs58 , } from "../src/address-utils"
@@ -38,6 +38,20 @@ describe("Test neuron precompile contract, set weights function", () => {
3838 await burnedRegister ( api , netuid , convertH160ToSS58 ( wallet . address ) , coldkey )
3939 const uid = await api . query . SubtensorModule . Uids . getValue ( netuid , convertH160ToSS58 ( wallet . address ) )
4040 assert . notEqual ( uid , undefined )
41+ // Disable admin freeze window and owner hyperparam rate limiting for tests
42+ {
43+ const alice = getAliceSigner ( )
44+
45+ // Set AdminFreezeWindow to 0
46+ const setFreezeWindow = api . tx . AdminUtils . sudo_set_admin_freeze_window ( { window : 0 } )
47+ const sudoFreezeTx = api . tx . Sudo . sudo ( { call : setFreezeWindow . decodedCall } )
48+ await waitForTransactionWithRetry ( api , sudoFreezeTx , alice )
49+
50+ // Set OwnerHyperparamRateLimit to 0
51+ const setOwnerRateLimit = api . tx . AdminUtils . sudo_set_owner_hparam_rate_limit ( { limit : BigInt ( 0 ) } )
52+ const sudoOwnerRateTx = api . tx . Sudo . sudo ( { call : setOwnerRateLimit . decodedCall } )
53+ await waitForTransactionWithRetry ( api , sudoOwnerRateTx , alice )
54+ }
4155 // disable reveal and enable direct set weights
4256 await setCommitRevealWeightsEnabled ( api , netuid , false )
4357 await setWeightsSetRateLimit ( api , netuid , BigInt ( 0 ) )
@@ -68,4 +82,4 @@ describe("Test neuron precompile contract, set weights function", () => {
6882 } ) ;
6983 }
7084 } )
71- } ) ;
85+ } ) ;
0 commit comments