Skip to content

Commit 1a31a67

Browse files
committed
fix: wrong ABI - using dev instead of prod and set hardcoded realmid to 1
1 parent 3c581d1 commit 1a31a67

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@cosmjs/stargate": "0.30.1",
4444
"@dotenvx/dotenvx": "^1.6.4",
4545
"@lit-protocol/accs-schemas": "^0.0.22",
46-
"@lit-protocol/contracts": "^0.0.81",
46+
"@lit-protocol/contracts": "^0.0.86",
4747
"@metamask/eth-sig-util": "5.0.2",
4848
"@mysten/sui.js": "^0.37.1",
4949
"@openagenda/verror": "^3.1.4",

packages/constants/src/lib/constants/mappers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import depd from 'depd';
22

3-
import { datilDev, datilTest, datil, nagaDev } from '@lit-protocol/contracts';
3+
import { datilDev, datilTest, datil, _nagaDev } from '@lit-protocol/contracts';
44

55
import { LIT_NETWORK_VALUES } from './constants';
66

@@ -14,12 +14,12 @@ export const NETWORK_CONTEXT_BY_NETWORK: {
1414
| typeof datilDev
1515
| typeof datilTest
1616
| typeof datil
17-
| typeof nagaDev;
17+
| typeof _nagaDev;
1818
} = {
1919
'datil-dev': datilDev,
2020
'datil-test': datilTest,
2121
datil: datil,
22-
'naga-dev': nagaDev,
22+
'naga-dev': _nagaDev,
2323
custom: datilDev,
2424
} as const;
2525

packages/contracts-sdk/src/lib/contracts-sdk.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,7 @@ export class LitContracts {
754754
context?: LitContractContext | LitContractResolverContext,
755755
rpcUrl?: string
756756
) {
757+
757758
let provider: ethers.providers.StaticJsonRpcProvider;
758759

759760
const _rpcUrl = rpcUrl || RPC_URL_BY_NETWORK[network];
@@ -810,6 +811,7 @@ export class LitContracts {
810811
'❌ Could not get staking contract address from contract context'
811812
);
812813
}
814+
813815
return new ethers.Contract(
814816
stakingContract.address,
815817
stakingContract.abi ?? StakingData.abi,
@@ -1164,8 +1166,10 @@ export class LitContracts {
11641166
rpcUrl
11651167
);
11661168

1169+
// this will be dynamically set see https://github.com/LIT-Protocol/js-sdk/pull/724
1170+
const realmId = 1;
11671171
const [epochInfo, minNodeCount, activeUnkickedValidatorStructs] =
1168-
await stakingContract['getActiveUnkickedValidatorStructsAndCounts']();
1172+
await stakingContract['getActiveUnkickedValidatorStructsAndCounts'](realmId);
11691173

11701174
const typedEpochInfo: EpochInfo = {
11711175
epochLength: ethers.BigNumber.from(epochInfo[0]).toNumber(),

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3020,10 +3020,10 @@
30203020
dependencies:
30213021
ajv "^8.12.0"
30223022

3023-
"@lit-protocol/contracts@^0.0.81":
3024-
version "0.0.81"
3025-
resolved "https://registry.yarnpkg.com/@lit-protocol/contracts/-/contracts-0.0.81.tgz#11f477df90a4de6e54a62f7acec0414636a98c23"
3026-
integrity sha512-L3d5cMrjVIxDAVpvX0huzoQh+03sDyr7Kn5UdlnWk/HhGAvMosvN/u8EyqJx0myAr4/HNTi52Lq9OdHs25wiBg==
3023+
"@lit-protocol/contracts@^0.0.86":
3024+
version "0.0.86"
3025+
resolved "https://registry.yarnpkg.com/@lit-protocol/contracts/-/contracts-0.0.86.tgz#adec861d0b775995523483b2fa5f4baf83d735a9"
3026+
integrity sha512-JtSjXwClG9wietQMERhSN1NqYas8JjQbso0FA9BAyv4svS3ejeKVwWcXUUvHPK9gDWPVhBzmvMNaB7ooR5UpBw==
30273027

30283028
"@ljharb/resumer@~0.0.1":
30293029
version "0.0.1"

0 commit comments

Comments
 (0)