LimeChain / matchstick

🔥 Unit testing framework for Subgraph development on The Graph protocol. ⚙️
MIT License
210 stars 18 forks source link

Update compatibility to @graphprotocol/graph-ts 0.23.x #217

Closed b0dhidharma closed 2 years ago

b0dhidharma commented 2 years ago
import { newMockEvent } from 'matchstick-as/assembly/index';
import { Deposited } from '../generated/Hub/Hub';

export function createNewDepositedEvent(): Deposited {
  let mockEvent = newMockEvent();
  let newDepositedEvent = new Deposited(
    mockEvent.address, 
    mockEvent.logIndex, 
    mockEvent.transactionLogIndex,
    mockEvent.logType, 
    mockEvent.block, 
    mockEvent.transaction,
    mockEvent.parameters
  );
  return newDepositedEvent;
}

Throws:

Argument of type 'import("/xxxx/node_modules/@graphprotocol/graph-ts/common/numbers").Address' is not assignable to parameter of type 'import("/xxxx/node_modules/@graphprotocol/graph-ts/common/numbers").Address'.
  Type 'ByteArray' is missing the following properties from type 'ByteArray': toI64, toU64ts(2345)

Probably due to the graph-ts mismatch. Since when fixing the address, then the logIndex throws same error.

juliankrispel commented 2 years ago

Nice I also experience this and other related issues