Skip to content

Commit

Permalink
add an in-memory-cache for function-signatures (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
nomo-app authored Nov 16, 2023
1 parent 16cb2e3 commit aa0af12
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/domain/entities/transactions/evm_transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ abstract base class EVMTransaction extends GenericTransaction {
});

FunctionSignature get getFunctionSignature {
return FunctionSignature.fromData(input);
if (!_cachedFunctionSigs.containsKey(hash)) {
_cachedFunctionSigs[hash] = FunctionSignature.fromData(input);
}
return _cachedFunctionSigs[hash]!;
}
}

Map<String, FunctionSignature> _cachedFunctionSigs = {};

0 comments on commit aa0af12

Please sign in to comment.