Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🩹 Fix blance reading submitting tx #246

Merged
merged 4 commits into from
Dec 2, 2024
Merged

Conversation

MattPoblete
Copy link
Collaborator

No description provided.

Copy link

vercel bot commented Dec 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
defindex-dapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 2, 2024 6:41pm
defindex-landing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 2, 2024 6:41pm
defindex-rust-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 2, 2024 6:41pm

@chopan123
Copy link
Member

@MattPoblete test is failing:

root@fa2114fe901d:/workspace/apps/contracts# yarn test-two-strat-vault testnet
yarn run v1.22.21
$ tsc && node dist/tests/testTwoStrategiesVault.js testnet
src/tests/testTwoStrategiesVault.ts:13:65 - error TS2305: Module '"./vault.js"' has no exported member 'getVaultBalanceInStrategy'.

13 import { ActionType, AssetInvestmentAllocation, depositToVault, getVaultBalanceInStrategy, Instruction, investVault, rebalanceVault, fetchParsedCurrentIdleFunds, fetchCurrentInvestedFunds } from "./vault.js";
                                                                   ~~~~~~~~~~~~~~~~~~~~~~~~~


Found 1 error in src/tests/testTwoStrategiesVault.ts:13

error Command failed with exit code 2.

@chopan123
Copy link
Member

eliminando el import tengo:

simulation_resp {
  _parsed: true,
  id: undefined,
  latestLedger: 1265317,
  events: [
    ChildStruct { _attributes: [Object] },
    ChildStruct { _attributes: [Object] }
  ],
  error: 'HostError: Error(WasmVm, UnexpectedSize)\n' +
    '\n' +
    'Event log (newest first):\n' +
    '   0: [Diagnostic Event] contract:CCDWGZ4UJH3FIEBZPF3HPBVFYFYRCWKA3KNLBF4RXTCHASWX5UG6G44Q, topics:[error, Error(WasmVm, UnexpectedSize)], data:["VM call failed: Func(MismatchingParameterLen)", deposit]\n' +
    '   1: [Diagnostic Event] topics:[fn_call, CCDWGZ4UJH3FIEBZPF3HPBVFYFYRCWKA3KNLBF4RXTCHASWX5UG6G44Q, deposit], data:[[100000000000], [0], GAX4I6FRYPXI5IN6KRL7PC3UEUV6IGPULBOMIXLLYZDOHJEK75PEHAKF, false]\n'
}
❌ Deposit failed: Error: Simulation error
    at invokeTransaction (file:///workspace/apps/contracts/dist/utils/tx.js:27:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async invokeCustomContract (file:///workspace/apps/contracts/dist/utils/contract.js:70:12)
    at async depositToVault (file:///workspace/apps/contracts/dist/tests/vault.js:46:18)
    at async file:///workspace/apps/contracts/dist/tests/testTwoStrategiesVault.js:107:136
node:internal/modules/run_main:129
    triggerUncaughtException(
    ^

Error: Simulation error
    at invokeTransaction (file:///workspace/apps/contracts/dist/utils/tx.js:27:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async invokeCustomContract (file:///workspace/apps/contracts/dist/utils/contract.js:70:12)
    at async depositToVault (file:///workspace/apps/contracts/dist/tests/vault.js:46:18)
    at async file:///workspace/apps/contracts/dist/tests/testTwoStrategiesVault.js:107:136

Node.js v20.18.0
error Command failed with exit code 1.

@MattPoblete
Copy link
Collaborator Author

eliminando el import tengo:

simulation_resp {
  _parsed: true,
  id: undefined,
  latestLedger: 1265317,
  events: [
    ChildStruct { _attributes: [Object] },
    ChildStruct { _attributes: [Object] }
  ],
  error: 'HostError: Error(WasmVm, UnexpectedSize)\n' +
    '\n' +
    'Event log (newest first):\n' +
    '   0: [Diagnostic Event] contract:CCDWGZ4UJH3FIEBZPF3HPBVFYFYRCWKA3KNLBF4RXTCHASWX5UG6G44Q, topics:[error, Error(WasmVm, UnexpectedSize)], data:["VM call failed: Func(MismatchingParameterLen)", deposit]\n' +
    '   1: [Diagnostic Event] topics:[fn_call, CCDWGZ4UJH3FIEBZPF3HPBVFYFYRCWKA3KNLBF4RXTCHASWX5UG6G44Q, deposit], data:[[100000000000], [0], GAX4I6FRYPXI5IN6KRL7PC3UEUV6IGPULBOMIXLLYZDOHJEK75PEHAKF, false]\n'
}
❌ Deposit failed: Error: Simulation error
    at invokeTransaction (file:///workspace/apps/contracts/dist/utils/tx.js:27:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async invokeCustomContract (file:///workspace/apps/contracts/dist/utils/contract.js:70:12)
    at async depositToVault (file:///workspace/apps/contracts/dist/tests/vault.js:46:18)
    at async file:///workspace/apps/contracts/dist/tests/testTwoStrategiesVault.js:107:136
node:internal/modules/run_main:129
    triggerUncaughtException(
    ^

Error: Simulation error
    at invokeTransaction (file:///workspace/apps/contracts/dist/utils/tx.js:27:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async invokeCustomContract (file:///workspace/apps/contracts/dist/utils/contract.js:70:12)
    at async depositToVault (file:///workspace/apps/contracts/dist/tests/vault.js:46:18)
    at async file:///workspace/apps/contracts/dist/tests/testTwoStrategiesVault.js:107:136

Node.js v20.18.0
error Command failed with exit code 1.

El vault al que se estaba intentando depositar era un vault hardcodeado y desplegado por un factory antiguo, se refactorizó el test para desplegar un nuevo vault cada vez que se ejecute

@chopan123
Copy link
Member

Me sigue tirando lo mismo :

simulation_resp {
  _parsed: true,
  id: undefined,
  latestLedger: 1267455,
  events: [
    ChildStruct { _attributes: [Object] },
    ChildStruct { _attributes: [Object] }
  ],
  error: 'HostError: Error(WasmVm, UnexpectedSize)\n' +
    '\n' +
    'Event log (newest first):\n' +
    '   0: [Diagnostic Event] contract:CBIPDDO5GYUOCP7HMAMSH66674AGTJCNBVPOUGILKAOKDL4HDOCOFXYD, topics:[error, Error(WasmVm, UnexpectedSize)], data:["VM call failed: Func(MismatchingParameterLen)", deposit]\n' +
    '   1: [Diagnostic Event] topics:[fn_call, CBIPDDO5GYUOCP7HMAMSH66674AGTJCNBVPOUGILKAOKDL4HDOCOFXYD, deposit], data:[[100000000000], [0], GC3JFCM3PSX7BHJ4RVYKYA7D4AH7GU52EL34B6BTR2POHOHISAXSDN7K, false]\n'
}

@chopan123 chopan123 merged commit 6a91a78 into main Dec 2, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 [Typescript Tests] Balances reading should not be submitted
2 participants