Skip to content

Commit 7756dd9

Browse files
Added README and fixed gas values inconsistencies
1 parent 82a26aa commit 7756dd9

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

packages/cactus-plugin-satp-hermes/README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ const gatewayConfig: {
137137
gid: {
138138
id: "gatewayId",
139139
name: "GatewayWithBesuConnection",
140+
identificationCredential: {
141+
signingAlgorithm: "SECP256K1", // the cryptographic algorithm used to generate the gateway's key pair
142+
pubKey: "0x03a34e1d66b78e47fa1bba3445a6019acb5b9c87d0c6ad81c09e7d496682ae81fc", // the public key of the gateway
143+
}
140144
version: [
141145
{
142146
"Core": "v02",
@@ -279,11 +283,13 @@ const leafConfig = {
279283
ledgerType: "BESU_2X" // Ledger type constant for Besu 2.x
280284
},
281285
signingCredential: {
282-
ethAccount: "0x736dC9B8258Ec5ab2419DDdffA9e1fa5C201D0b4", // Ethereum account address
286+
bridgeOwnerAddress: "0x736dC9B8258Ec5ab2419DDdffA9e1fa5C201D0b4", // Ethereum account address of the owner of the bridge
283287
secret: "0xc31e76f70d6416337d3a7b7a8711a43e30a14963b5ba622fa6c9dbb5b4555986", // Private key in hex
284288
type: "PRIVATE_KEY_HEX"
285289
},
286-
gas: 999999999999999, // Default gas limit for transactions
290+
gasConfig: {
291+
gasLimit: 999999999999999, // Default gas limit for transactions
292+
},
287293
connectorOptions: {
288294
rpcApiHttpHost: "http://172.20.0.6:8545", // Besu JSON-RPC HTTP endpoint
289295
rpcApiWsHost: "ws://172.20.0.6:8546" // Besu JSON-RPC WebSocket endpoint
@@ -301,11 +307,15 @@ const leafConfig = {
301307
ledgerType: "ETHEREUM" // Ledger type constant for Ethereum
302308
},
303309
signingCredential: {
304-
ethAccount: "0x09D16c22216BC873e53c8D93A38420f48A81dF1B", // Ethereum account address
310+
bridgeOwnerAddress: "0x09D16c22216BC873e53c8D93A38420f48A81dF1B", // Ethereum account address
305311
secret: "test", // Key store password or secret
306312
type: "GETH_KEYCHAIN_PASSWORD" // Credential type for geth keychain
307313
},
308-
gas: 5000000, // Default gas limit for transactions
314+
gasConfig: {
315+
gas: "6721975", // Default gas limit for transactions
316+
gasPrice: "20000000000" // Default gas Price
317+
}
318+
309319
connectorOptions: {
310320
rpcApiHttpHost: "http://172.20.0.7:8545", // Ethereum JSON-RPC HTTP endpoint
311321
rpcApiWsHost: "ws://172.20.0.7:8546" // Ethereum JSON-RPC WebSocket endpoint
@@ -322,6 +332,10 @@ const gatewayConfig = {
322332
gid: {
323333
id: "gatewayId",
324334
name: "GatewayWithBesuConnection",
335+
identificationCredential: {
336+
signingAlgorithm: "SECP256K1",
337+
pubKey: "0x03a34e1d66b78e47fa1bba3445a6019acb5b9c87d0c6ad81c09e7d496682ae81fc",
338+
}
325339
version: [{ Core: "v02", Architecture: "v02", Crash: "v02" }],
326340
proofID: "mockProofID10",
327341
address: "http://gateway1.satp-hermes",
@@ -341,11 +355,13 @@ const gatewayConfig = {
341355
ledgerType: "BESU_2X",
342356
},
343357
signingCredential: {
344-
ethAccount: "0x736dC9B8258Ec5ab2419DDdffA9e1fa5C201D0b4",
358+
bridgeOwnerAddress: "0x736dC9B8258Ec5ab2419DDdffA9e1fa5C201D0b4",
345359
secret: "0xc31e76f70d6416337d3a7b7a8711a43e30a14963b5ba622fa6c9dbb5b4555986",
346360
type: "PRIVATE_KEY_HEX",
347361
},
348-
gas: 999999999999999,
362+
gasConfig: {
363+
gasLimit: 999999999999999,
364+
},
349365
connectorOptions: {
350366
rpcApiHttpHost: "http://172.20.0.6:8545",
351367
rpcApiWsHost: "ws://172.20.0.6:8546",

packages/cactus-plugin-satp-hermes/src/main/typescript/services/validation/config-validating-functions/bridges-config-validating-functions/validate-besu-config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ function isGasConfig(obj: unknown): obj is BesuGasConfig {
111111
) {
112112
return false;
113113
}
114+
return true;
114115
}
115-
return true;
116+
return false;
116117
}
117118

118119
export function isBesuNetworkId(obj: NetworkId) {

packages/cactus-plugin-satp-hermes/src/test/typescript/environments/besu-test-environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class BesuTestEnvironment {
9898
public besuConfig!: IBesuNetworkConfig;
9999

100100
public gasConfig: BesuGasConfig = {
101-
gasLimit: "999999999",
101+
gasLimit: "999999999999999",
102102
};
103103

104104
private dockerContainerIP?: string;

packages/cactus-plugin-satp-hermes/src/test/typescript/unit/config-validating-functions/validate-cc-config.test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ const besuConfig = {
225225
wrapperContractAddress: "0x09D16c22216BC873e53c8D93A38420f48A81dF1B",
226226
wrapperContractName: "exampleWrapperContractName",
227227
gasConfig: {
228-
gas: "999999999999999",
229-
gasPrice: "20000000000",
228+
gasLimit: "999999999999999",
230229
},
231230
} as Partial<IBesuNetworkConfig> & INetworkOptions;
232231

@@ -705,7 +704,6 @@ describe("Validate CC Config", () => {
705704
wrapperContractName: true, //should be a string
706705
gasConfig: {
707706
gasLimit: "999999999999999",
708-
gasPrice: "20000000000",
709707
},
710708
};
711709
const bridgeConfig = [badBesuConfig];
@@ -751,7 +749,6 @@ describe("Validate CC Config", () => {
751749
wrapperContractName: "exampleWrapperContractName",
752750
gasConfig: {
753751
gasLimit: "999999999999999",
754-
gasPrice: "20000000000",
755752
},
756753
};
757754
const bridgeConfig = [badBesuConfig];

0 commit comments

Comments
 (0)