ci: clean up CI workflows and fix package dependencies
Some checks failed
Integration Tests / test-service-integration (push) Successful in 2m16s
Package Tests / Python package - aitbc-agent-sdk (push) Successful in 25s
Package Tests / Python package - aitbc-core (push) Successful in 22s
Package Tests / Python package - aitbc-crypto (push) Successful in 14s
Package Tests / Python package - aitbc-sdk (push) Successful in 18s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 6s
Package Tests / JavaScript package - aitbc-token (push) Successful in 21s
Production Tests / Production Integration Tests (push) Failing after 10s
Python Tests / test-python (push) Failing after 2m41s
Security Scanning / security-scan (push) Failing after 46s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Successful in 16s
Smart Contract Tests / lint-solidity (push) Successful in 12s
Some checks failed
Integration Tests / test-service-integration (push) Successful in 2m16s
Package Tests / Python package - aitbc-agent-sdk (push) Successful in 25s
Package Tests / Python package - aitbc-core (push) Successful in 22s
Package Tests / Python package - aitbc-crypto (push) Successful in 14s
Package Tests / Python package - aitbc-sdk (push) Successful in 18s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 6s
Package Tests / JavaScript package - aitbc-token (push) Successful in 21s
Production Tests / Production Integration Tests (push) Failing after 10s
Python Tests / test-python (push) Failing after 2m41s
Security Scanning / security-scan (push) Failing after 46s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Successful in 16s
Smart Contract Tests / lint-solidity (push) Successful in 12s
- Simplified npm install commands in CI workflows by removing fallback logic - Added aitbc-crypto local dependency installation for aitbc-sdk in package-tests.yml - Removed aitbc-token specific Hardhat dependency workarounds from package-tests.yml - Fixed bare except clause in agent_daemon.py to catch specific json.JSONDecodeError - Moved aitbc-crypto from poetry.dependencies to standard dependencies in aitbc-sdk - Fixed MyPy type errors in receip
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
import { ethers } from "hardhat";
|
||||
import type { HardhatEthers } from "@nomicfoundation/hardhat-ethers/types";
|
||||
import { network } from "hardhat";
|
||||
import type { NetworkConnection } from "hardhat/types/network";
|
||||
import { AIToken__factory } from "../typechain-types";
|
||||
|
||||
type HardhatConnection = NetworkConnection & {
|
||||
ethers: HardhatEthers;
|
||||
};
|
||||
|
||||
type HexString = `0x${string}`;
|
||||
|
||||
type EnvValue = string & {}
|
||||
type EnvValue = string & {};
|
||||
|
||||
function requireEnv(name: string): EnvValue {
|
||||
const value = process.env[name]?.trim();
|
||||
@@ -20,7 +26,9 @@ function parseUnits(value: string): bigint {
|
||||
}
|
||||
return BigInt(value);
|
||||
} catch (error) {
|
||||
throw new Error(`UNITS must be a BigInt-compatible value, received ${value}`);
|
||||
throw new Error(
|
||||
`UNITS must be a BigInt-compatible value, received ${value}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,18 +40,25 @@ function assertHex(value: string, name: string): HexString {
|
||||
}
|
||||
|
||||
async function main() {
|
||||
const contractAddress = assertHex(requireEnv("AITOKEN_ADDRESS"), "AITOKEN_ADDRESS");
|
||||
const { ethers } = (await network.connect()) as HardhatConnection;
|
||||
const contractAddress = assertHex(
|
||||
requireEnv("AITOKEN_ADDRESS"),
|
||||
"AITOKEN_ADDRESS",
|
||||
);
|
||||
const providerAddress = requireEnv("PROVIDER_ADDRESS");
|
||||
const units = parseUnits(requireEnv("UNITS"));
|
||||
const receiptHash = assertHex(requireEnv("RECEIPT_HASH"), "RECEIPT_HASH");
|
||||
const signature = assertHex(requireEnv("ATTESTOR_SIGNATURE"), "ATTESTOR_SIGNATURE");
|
||||
const signature = assertHex(
|
||||
requireEnv("ATTESTOR_SIGNATURE"),
|
||||
"ATTESTOR_SIGNATURE",
|
||||
);
|
||||
|
||||
const coordinatorIndex = Number(process.env.COORDINATOR_SIGNER_INDEX ?? "1");
|
||||
const signers = await ethers.getSigners();
|
||||
const coordinator = signers[coordinatorIndex];
|
||||
if (!coordinator) {
|
||||
throw new Error(
|
||||
`COORDINATOR_SIGNER_INDEX=${coordinatorIndex} does not correspond to an available signer`
|
||||
`COORDINATOR_SIGNER_INDEX=${coordinatorIndex} does not correspond to an available signer`,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -52,7 +67,12 @@ async function main() {
|
||||
console.log("Units:", units.toString());
|
||||
|
||||
const token = AIToken__factory.connect(contractAddress, coordinator);
|
||||
const tx = await token.mintWithReceipt(providerAddress, units, receiptHash, signature);
|
||||
const tx = await token.mintWithReceipt(
|
||||
providerAddress,
|
||||
units,
|
||||
receiptHash,
|
||||
signature,
|
||||
);
|
||||
const receipt = await tx.wait();
|
||||
|
||||
console.log("Mint transaction hash:", receipt?.hash ?? tx.hash);
|
||||
|
||||
Reference in New Issue
Block a user