Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/evm/metagraph.precompile.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,14 @@ describe("Neuron metagraph data test", () => {
const trust = await metagraphContract.getTrust(netuid, uid);
expect(trust).to.not.be.undefined;

const consunsus = await metagraphContract.getConsensus(netuid, uid);
expect(consunsus).to.not.be.undefined;
const consensus = await metagraphContract.getConsensus(netuid, uid);
expect(consensus).to.not.be.undefined;

const incentive = await metagraphContract.getIncentive(netuid, uid);
expect(incentive).to.not.be.undefined;

const diviends = await metagraphContract.getDividends(netuid, uid);
expect(diviends).to.not.be.undefined;
const dividends = await metagraphContract.getDividends(netuid, uid);
expect(dividends).to.not.be.undefined;

const emission = await metagraphContract.getEmission(netuid, uid);
expect(emission).to.not.be.undefined;
Expand Down
5 changes: 2 additions & 3 deletions src/evm/neuron.precompile.reveal-weights.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@ describe("EVM neuron weights test", () => {
await usingEthApi(async (provider) => {
const signer = new ethers.Wallet(fundedEthWallet.privateKey, provider);
const contract = new ethers.Contract(INEURON_ADDRESS, INeuronABI, signer);
const commit_hash = getCommitHash(netuid);
const bigNumberValue = ethers.toBigInt(commit_hash);
const tx = await contract.commitWeights(netuid, bigNumberValue);
const commitHash = getCommitHash(netuid);
const tx = await contract.commitWeights(netuid, commitHash);
await tx.wait();
});

Expand Down
22 changes: 7 additions & 15 deletions src/evm/subnet.precompile.hyperparameter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,23 +90,15 @@ describe("Subnet precompile test", () => {
const contract = new ethers.Contract(ISUBNET_ADDRESS, ISubnetABI, signer);

// Execute transaction
const name = ethers.toUtf8Bytes("name");
const repo = ethers.toUtf8Bytes("repo");
const contact = ethers.toUtf8Bytes("contact");
const subnetUrl = ethers.toUtf8Bytes("subnetUrl");
const discord = ethers.toUtf8Bytes("discord");
const description = ethers.toUtf8Bytes("description");
const additional = ethers.toUtf8Bytes("additional");

const tx = await contract.registerNetwork(
hotkey2.publicKey,
name,
repo,
contact,
subnetUrl,
discord,
description,
additional
"name",
"repo",
"contact",
"subnetUrl",
"discord",
"description",
"additional"
);
await tx.wait();

Expand Down
54 changes: 27 additions & 27 deletions src/util/precompile.js
Original file line number Diff line number Diff line change
Expand Up @@ -604,9 +604,9 @@ export const ISubnetABI = [
name: "getImmunityPeriod",
outputs: [
{
internalType: "uint64",
internalType: "uint16",
name: "",
type: "uint64",
type: "uint16",
},
],
stateMutability: "view",
Expand Down Expand Up @@ -680,9 +680,9 @@ export const ISubnetABI = [
name: "getMaxWeightLimit",
outputs: [
{
internalType: "uint64",
internalType: "uint16",
name: "",
type: "uint64",
type: "uint16",
},
],
stateMutability: "view",
Expand Down Expand Up @@ -1017,9 +1017,9 @@ export const ISubnetABI = [
type: "uint16",
},
{
internalType: "uint64",
internalType: "uint16",
name: "immunityPeriod",
type: "uint64",
type: "uint16",
},
],
name: "setImmunityPeriod",
Expand Down Expand Up @@ -1126,9 +1126,9 @@ export const ISubnetABI = [
type: "uint16",
},
{
internalType: "uint64",
internalType: "uint16",
name: "maxWeightLimit",
type: "uint64",
type: "uint16",
},
],
name: "setMaxWeightLimit",
Expand Down Expand Up @@ -1335,48 +1335,48 @@ export const ISubnetABI = [
{
internalType: "bytes32",
name: "hotkey",
type: "bytes32",
type: "bytes32"
},
{
internalType: "bytes",
internalType: "string",
name: "subnetName",
type: "bytes",
type: "string"
},
{
internalType: "bytes",
internalType: "string",
name: "githubRepo",
type: "bytes",
type: "string"
},
{
internalType: "bytes",
internalType: "string",
name: "subnetContact",
type: "bytes",
type: "string"
},
{
internalType: "bytes",
internalType: "string",
name: "subnetUrl",
type: "bytes",
type: "string"
},
{
internalType: "bytes",
internalType: "string",
name: "discord",
type: "bytes",
type: "string"
},
{
internalType: "bytes",
internalType: "string",
name: "description",
type: "bytes",
type: "string"
},
{
internalType: "bytes",
internalType: "string",
name: "additional",
type: "bytes",
},
type: "string"
}
],
name: "registerNetwork",
outputs: [],
stateMutability: "payable",
type: "function",
type: "function"
},
];

Expand All @@ -1389,9 +1389,9 @@ export const INeuronABI = [
type: "uint16",
},
{
internalType: "uint256",
internalType: "bytes32",
name: "commitHash",
type: "uint256",
type: "bytes32",
},
],
name: "commitWeights",
Expand Down