Skip to content

Commit

Permalink
fix: update token registry package version (#32)
Browse files Browse the repository at this point in the history
* fix: update token registry package version

* fix: update test case

* fix: linting

* fix: linting
  • Loading branch information
nghaninn authored Nov 5, 2024
1 parent 148cfa1 commit 168d929
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 23 deletions.
2 changes: 1 addition & 1 deletion examples/v5/raw-documents/example.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"proof": {
"type": "OpenAttestationProofMethod",
"method": "TOKEN_REGISTRY",
"value": "0x96cc41e7007Dee20eB409586E2e8206d5053219B",
"value": "0x0f99945c7ebae71a9a615c422d716fe1eeab2b2e",
"revocation": {
"type": "NONE"
}
Expand Down
8 changes: 4 additions & 4 deletions examples/v5/wrapped-documents/example.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"proof": {
"type": "OpenAttestationProofMethod",
"method": "TOKEN_REGISTRY",
"value": "0x96cc41e7007Dee20eB409586E2e8206d5053219B",
"value": "0x0f99945c7ebae71a9a615c422d716fe1eeab2b2e",
"revocation": {
"type": "NONE"
}
Expand All @@ -56,10 +56,10 @@
"proof": {
"type": "OpenAttestationMerkleProofSignature2018",
"proofPurpose": "assertionMethod",
"targetHash": "042ff9d3c76b60ff4cb5cea2a21306da1be1989e31f0879b1d8c3c82848b1e10",
"targetHash": "c552c365670f15fbb31486b2d96c15b1cc5fd53b6f178f4e7075c156119deed2",
"proofs": [],
"merkleRoot": "042ff9d3c76b60ff4cb5cea2a21306da1be1989e31f0879b1d8c3c82848b1e10",
"salts": "W3sidmFsdWUiOiIzMGQ2NTVkN2ZjZTQ3NWIwZjNkMzk1NzAyOGE1NzBjMDY4MDA5M2Q2YWI4ZjliNTFiODU5M2UyYTcxNjEwNmZiIiwicGF0aCI6InZlcnNpb24ifSx7InZhbHVlIjoiOTIwOTYyNGYxNTIzNWQ3NDc3YjEwOWMyMGZmNTMwYjcxYjRiYjA2ZTk1NzY5ZjE3OWMxMTA5Y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ated": []
}
Expand Down
19 changes: 15 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"@snyk/protect": "^1.1196.0",
"@tradetrust-tt/dnsprove": "^2.12.2",
"@tradetrust-tt/document-store": "^2.7.0",
"@tradetrust-tt/token-registry": "^5.0.0-alpha.1",
"@tradetrust-tt/token-registry": "^5.0.0-alpha.3",
"@tradetrust-tt/tradetrust": "^6.9.6",
"@tradetrust-tt/tradetrust-config": "^1.14.1",
"@tradetrust-tt/tt-verify": "^8.9.1",
Expand All @@ -90,9 +90,6 @@
"web3-utils": "^1.3.6",
"yargs": "^17.0.1"
},
"overrides": {
"@tradetrust-tt/token-registry": "^5.0.0-alpha.1"
},
"license": "GPL-3.0",
"babel": {
"presets": [
Expand Down
20 changes: 17 additions & 3 deletions src/implementations/deploy/token-registry/token-registry.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { deployTokenRegistry } from "./token-registry";
import { encodeInitParams } from "./helpers";
import { TDocDeployer__factory } from "@tradetrust-tt/token-registry/dist/contracts";
import { DeploymentEvent } from "@tradetrust-tt/token-registry/dist/contracts/contracts/utils/TDocDeployer";
import { Contract } from "ethers";
import { DeployTokenRegistryCommand } from "../../../commands/deploy/deploy.types";
import { DeploymentEvent } from "@tradetrust-tt/token-registry/dist/contracts/contracts/utils/TDocDeployer";
import { encodeInitParams } from "./helpers";
import { deployTokenRegistry } from "./token-registry";

const deployParams: DeployTokenRegistryCommand = {
registryName: "Test",
Expand All @@ -20,6 +21,19 @@ describe("deploy Token Registry", () => {
mockedEthersContract.prototype.deploy = jest.fn();
const mockedDeploy: jest.Mock = mockedEthersContract.prototype.deploy;

const factoryMock = jest.spyOn(TDocDeployer__factory, "connect");
factoryMock.mockImplementation(
() =>
({
interface: {
getEventTopic: jest
.fn()
.mockReturnValue("0x3588ebb5c75fdf91927f8472318f41513ee567c2612a5ce52ac840dcf6f162f5"),
},
deploy: mockedDeploy,
} as any)
);

// increase timeout because ethers is throttling
jest.setTimeout(30000);

Expand Down
4 changes: 2 additions & 2 deletions src/implementations/title-escrow/surrenderDocument.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ describe("title-escrow", () => {
ownerOf: mockedOwnerOf,
});
mockedConnectTitleEscrowFactory.mockReturnValue({
surrender: mockSurrender,
returnToIssuer: mockSurrender,
callStatic: {
surrender: mockCallStaticSurrender,
returnToIssuer: mockCallStaticSurrender,
},
});

Expand Down
10 changes: 5 additions & 5 deletions src/implementations/title-escrow/surrenderDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const surrenderDocument = async ({
const titleEscrow = await connectToTitleEscrow({ tokenId, address, wallet });
if (dryRun) {
await dryRunMode({
estimatedGas: await titleEscrow.estimateGas.surrender("0x"),
estimatedGas: await titleEscrow.estimateGas.returnToIssuer("0x"),
network,
});
process.exit(0);
Expand All @@ -31,13 +31,13 @@ export const surrenderDocument = async ({
const gasFees = await getGasFees({ provider: wallet.provider, ...rest });
trace(`Gas maxFeePerGas: ${gasFees.maxFeePerGas}`);
trace(`Gas maxPriorityFeePerGas: ${gasFees.maxPriorityFeePerGas}`);
await titleEscrow.callStatic.surrender("0x");
await titleEscrow.callStatic.returnToIssuer("0x");
signale.await(`Sending transaction to pool`);
transaction = await titleEscrow.surrender("0x", { ...gasFees });
transaction = await titleEscrow.returnToIssuer("0x", { ...gasFees });
} else {
await titleEscrow.callStatic.surrender("0x");
await titleEscrow.callStatic.returnToIssuer("0x");
signale.await(`Sending transaction to pool`);
transaction = await titleEscrow.surrender("0x");
transaction = await titleEscrow.returnToIssuer("0x");
}

trace(`Tx hash: ${transaction.hash}`);
Expand Down

0 comments on commit 168d929

Please sign in to comment.