Skip to content

Commit

Permalink
build: web3js update and compilation works
Browse files Browse the repository at this point in the history
Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
  • Loading branch information
outSH committed Jul 6, 2023
1 parent 752add1 commit 4525596
Show file tree
Hide file tree
Showing 21 changed files with 734 additions and 347 deletions.
9 changes: 5 additions & 4 deletions packages/cactus-plugin-ledger-connector-ethereum/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@
"rxjs": "7.8.1",
"sanitize-html": "2.7.0",
"typescript-optional": "2.0.1",
"web3": "1.10.0",
"web3-eth-contract": "1.10.0",
"web3-utils": "1.10.0"
"web3": "4.0.2",
"web3-eth-contract": "4.0.2",
"web3-utils": "4.0.2"
},
"devDependencies": {
"@hyperledger/cactus-plugin-keychain-memory": "2.0.0-alpha.1",
Expand All @@ -84,7 +84,8 @@
"@types/minimist": "1.2.2",
"@types/sanitize-html": "2.6.2",
"chalk": "4.1.2",
"web3-eth": "1.10.0"
"web3-eth": "4.0.2",
"web3-eth-accounts": "4.0.2"
},
"engines": {
"node": ">=10",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,61 +217,25 @@
"nullable": false
},
"from": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
}
]
"type": "string"
},
"to": {
"oneOf": [
{
"type": "string"
}
]
"type": "string"
},
"value": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
}
]
"type": "string"
},
"gas": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
}
]
"type": "string"
},
"gasPrice": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
}
]
"type": "string"
},
"nonce": {
"type": "number"
},
"data": {
"oneOf": [
{
"type": "string"
}
]
"type": "string"
}
}
},
Expand Down Expand Up @@ -300,7 +264,7 @@
"pattern": "^0x([A-Fa-f0-9]{64})$"
},
"transactionIndex": {
"type": "number",
"type": "string",
"nullable": false
},
"blockHash": {
Expand All @@ -310,11 +274,11 @@
"pattern": "^0x([A-Fa-f0-9]{64})$"
},
"blockNumber": {
"type": "number",
"type": "string",
"nullable": false
},
"gasUsed": {
"type": "number",
"type": "string",
"nullable": false
},
"contractAddress": {
Expand Down Expand Up @@ -793,9 +757,7 @@
"additionalProperties": false,
"properties": {
"abi": {
"description": "The application binary interface of the solidity contract",
"type": "array",
"items": {}
"description": "The application binary interface of the solidity contract"
},
"address": {
"description": "Deployed solidity contract address",
Expand Down Expand Up @@ -872,46 +834,28 @@
"Web3BlockHeader": {
"type": "object",
"required": [
"number",
"hash",
"parentHash",
"nonce",
"sha3Uncles",
"logsBloom",
"transactionRoot",
"stateRoot",
"receiptRoot",
"miner",
"extraData",
"gasLimit",
"gasUsed",
"timestamp"
"gasUsed"
],
"properties": {
"number": {
"type": "number"
},
"hash": {
"type": "string"
},
"parentHash": {
"type": "string"
},
"nonce": {
"type": "string"
},
"sha3Uncles": {
"type": "string"
},
"logsBloom": {
"type": "string"
"type": "array",
"items": {
"type": "string"
}
},
"transactionsRoot": {
"type": "string"
},
"stateRoot": {
"type": "string"
},
"receiptsRoot": {
"type": "string"
},
Expand All @@ -924,24 +868,14 @@
"miner": {
"type": "string"
},
"extraData": {
"type": "string"
},
"gasLimit": {
"type": "integer"
"type": "string"
},
"gasUsed": {
"type": "integer"
"type": "string"
},
"timestamp": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
}
]
"type": "string"
}
}
},
Expand Down Expand Up @@ -972,8 +906,7 @@
"nullable": true
},
"blockNumber": {
"type": "number",
"nullable": true
"type": "string"
},
"transactionIndex": {
"type": "number",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
WatchBlocksV1Progress,
} from "../generated/openapi/typescript-axios";
import { Configuration } from "../generated/openapi/typescript-axios/configuration";
import { AbiItem } from "web3-utils";
import { ContractAbi } from "web3";

export class EthereumApiClientOptions extends Configuration {
readonly logLevel?: LogLevelDesc;
Expand All @@ -37,7 +37,7 @@ export type EthereumRequestInputWeb3EthContractMethod = {

// Common input types for sending requests
export type EthereumRequestInputContract = {
abi?: AbiItem[];
abi?: ContractAbi;
address?: string;
};
export type EthereumRequestInputMethod =
Expand Down Expand Up @@ -198,7 +198,7 @@ export class EthereumApiClient

// Prepare input
const invokeArgs: InvokeRawWeb3EthContractV1Request = {
abi: contract.abi as AbiItem[],
abi: contract.abi as ContractAbi,
address: contract.address as string,
invocationType: method.command,
invocationParams: args,
Expand Down
Loading

0 comments on commit 4525596

Please sign in to comment.