FuelLabs / sway-by-example-lib

Library for compiled sway programs
MIT License
17 stars 7 forks source link

ContractNotInInputs when trying to call one to another through a flashloan #13

Open calldelegation opened 1 year ago

calldelegation commented 1 year ago

Cargo Version: 1.65.0 (4bc8f24d3 2022-10-20) Forc Version: 0.31.3

Replicate Bug:

  1. clone repo git clone git@github.com:calldelegation/sway-by-example-lib.git
  2. cd sway-by-example-lib
  3. checkout branch git checkout add/flashloans
  4. build flashloan contractcd flashloans/project/contracts/flashloaner && forc build
  5. cd ..
  6. build liquidity pool contract cd liquidity_pool && forc build
  7. run tests cargo test

Error:


test functions::flashloan::success::gets_some ... FAILED

failures:

---- functions::flashloan::success::gets_some stdout ----
In here! 0000000000000000000000000000000000000000000000000000000000000000
thread 'functions::flashloan::success::gets_some' panicked at 'called `Result::unwrap()` on an `Err` value: RevertTransactionError("ContractNotInInputs", [Call { id: 0000000000000000000000000000000000000000000000000000000000000000, to: 6909a2948800bf8feced01494050ede6578f6c1fdeb35f64350d6d04fbb6e245, amount: 0, asset_id: 0000000000000000000000000000000000000000000000000000000000000000, gas: 1000000, param1: 44721741, param2: 10472, pc: 11664, is: 11664 }, Panic { id: 6909a2948800bf8feced01494050ede6578f6c1fdeb35f64350d6d04fbb6e245, reason: InstructionResult { reason: ContractNotInInputs, instruction: Instruction { op: 45, ra: 16, rb: 18, rc: 19, rd: 17, imm06: 209, imm12: 1233, imm18: 74961, imm24: 4269265 } }, pc: 11892, is: 11664, contract_id: None }, ScriptResult { result: Panic, gas_used: 8792 }])', tests/utils/mod.rs:57:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    functions::flashloan::success::gets_some

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.99s

error: test failed, to rerun pass `--test `integration_tests```