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

handle the tuple returned this error: "LendAsLimitOrder(indexed ..." not found in contract "Contract" of data source #1615

Open
leanlp opened this issue Mar 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@leanlp
Copy link

leanlp commented Mar 22, 2024

Which packages are impacted by your issue?

@graphprotocol/graph-ts

Describe the issue

I try to decode the tuple with this code.

  let entity = new LendAsLimitOrder(
    event.transaction.hash.concatI32(event.logIndex.toI32()))
  
let data = event.params.curveRelativeTime;

  let decoded = ethereum.decode(
    "(uint256[],int256[],uint256[])",
    data
  );
  
if (decoded) {
  
  let decodedTuple = decoded.toTuple()
  
 
  let maturities = decodedTuple[0]//.toBigIntArray();
  let aprs = decodedTuple[1]//.toBigIntArray(); 
  let marketRateMultipliers = decodedTuple[2]//.toBigIntArray();


  entity.maxDueDate = event.params.maxDueDate
 entity.curveRelativeTime_maturities =
    maturities.toBigIntArray()
  entity.curveRelativeTime_aprs = aprs.toBigIntArray();
  entity.curveRelativeTime_marketRateMultipliers =
    marketRateMultipliers.toBigIntArray();

abi= { "type": "event", "name": "LendAsLimitOrder", "inputs": [ { "name": "maxDueDate", "type": "uint256", "indexed": true, "internalType": "uint256" }, { "name": "curveRelativeTime", "type": "tuple", "indexed": true, "internalType": "struct YieldCurve", "components": [ { "name": "maturities", "type": "uint256[]", "internalType": "uint256[]" }, { "name": "aprs", "type": "int256[]", "internalType": "int256[]" }, { "name": "marketRateMultipliers", "type": "uint256[]", "internalType": "uint256[]" } ] } ], "anonymous": false }

event on the contract = event LendAsLimitOrder(uint256 indexed maxDueDate, YieldCurve indexed curveRelativeTime);

Error on subgraph indexer = ```Subgraph failed with non-deterministic error: failed to process trigger: block #5532840 (0x76ae…87f4), transaction 27cf537a863f1f2fe02d6ef7ad5703a24891f44322452eb35bbe141b7c8e01c5: Event with the signature "LendAsLimitOrder(indexed uint256,(indexed uint256[],int256[],uint256[]))" not found in contract "Contract" of data source "Contract", retry_delay_s: 248, attempt: 1
INFO
2024-03-22 05:29:37 p.m.



### Steps to Reproduce the Bug or Issue

when try to sync my subgraph throw this error : 
Subgraph failed with non-deterministic error: failed to process trigger: block #5532840 (0x76ae…87f4), transaction 27cf537a863f1f2fe02d6ef7ad5703a24891f44322452eb35bbe141b7c8e01c5: Event with the signature "LendAsLimitOrder(indexed uint256,(indexed uint256[],int256[],uint256[]))" not found in contract "Contract" of data source "Contract", retry_delay_s: 248, attempt: 1

### Expected behavior

save the tuple 

### Screenshots or Videos

_No response_

### Platform


"dependencies": {
    "@graphprotocol/graph-cli": "0.64.1",
    "@graphprotocol/graph-ts": "0.32.0"

### Subgraph Manifest

 - event: LendAsLimitOrder(indexed uint256,(indexed uint256[],int256[],uint256[]))
          handler: handleLendAsLimitOrder

### Subgraph GraphQL Schema

type LendAsLimitOrder @entity(immutable: true) {
  id: Bytes!
  maxDueDate: BigInt! # uint256
  curveRelativeTime_maturities: [BigInt!]! # uint256[]
  curveRelativeTime_aprs: [BigInt!]! # int256[]
  curveRelativeTime_marketRateMultipliers: [BigInt!]! # uint256[]
  blockNumber: BigInt!
  blockTimestamp: BigInt!
  transactionHash: Bytes!
}

### Additional context

_No response_
@leanlp leanlp added the bug Something isn't working label Mar 22, 2024
@alex-pakalniskis alex-pakalniskis moved this to Bug in Tooling Oct 15, 2024
@YaroShkvorets
Copy link
Collaborator

@leanlp sorry for late reply, can you provide a contract address that causes this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Bug
Development

No branches or pull requests

2 participants