mirror of
https://github.com/cerc-io/watcher-ts
synced 2026-09-11 18:24:05 +00:00
Implement method for storage based access in subgraph mapping code (#162)
* Implement storage call in subgraph mapping code * Add test for mapping type variable storage call * Use vulcanize graph-ts * Revert to graph-ts version 0.22.1
This commit is contained in:
@@ -159,6 +159,27 @@ export function testStructEthCall (): void {
|
||||
}
|
||||
}
|
||||
|
||||
export function testGetStorageValue (): void {
|
||||
log.debug('In test get storage value', []);
|
||||
|
||||
// Bind the contract to the address.
|
||||
const contractAddress = dataSource.address();
|
||||
const contract = Example1.bind(contractAddress);
|
||||
const res = contract.getStorageValue('_test', []);
|
||||
log.debug('Storage call result: {}', [res!.toBigInt().toString()]);
|
||||
}
|
||||
|
||||
export function testMapStorageValue (): void {
|
||||
log.debug('In test map storage value', []);
|
||||
|
||||
// Bind the contract to the address.
|
||||
const contractAddress = dataSource.address();
|
||||
const contract = Example1.bind(contractAddress);
|
||||
const addressValue = ethereum.Value.fromAddress(Address.zero());
|
||||
const res = contract.getStorageValue('addressUintMap', [addressValue]);
|
||||
log.debug('Storage call result: {}', [res!.toBigInt().toString()]);
|
||||
}
|
||||
|
||||
export function testBytesToHex (): string {
|
||||
log.debug('In test bytesToHex', []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user