-
Notifications
You must be signed in to change notification settings - Fork 325
Opdata 3775 remove view function indexer result decimals #4099
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
base: main
Are you sure you want to change the base?
Opdata 3775 remove view function indexer result decimals #4099
Conversation
🦋 Changeset detectedLatest commit: 45f156a The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
'@chainlink/view-function-multi-chain-adapter': minor | ||
--- | ||
|
||
USDO PoR EA Update - Remove viewFunctionIndexerResultDecimals input param |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For major
need to add more details on what the NOP should do
} | ||
} | ||
|
||
async _get_decimals(networkName: string, address: string): Promise<number> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you do this instead? Simpler
const abi = [
"function decimals() view returns (uint8)"
];
const token = new ethers.Contract(tokenAddress, abi, provider);
const decimals = await token.decimals();
const [decodedDecimals] = decimalsIface.decodeFunctionResult('decimals', decimalsEncoded) | ||
decimals = Number(decodedDecimals) | ||
} catch (err) { | ||
logger.warn(`Error fetching decimals, defaulting to 0: ${err}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think defaulting to 0 is the right thing to do, we should prob throw an exception
Closes #OPDATA-3775
https://smartcontract-it.atlassian.net/browse/OPDATA-3775
Description
Remove viewFunctionIndexerResultDecimals input param
Changes
view-function-multi-chain queries decimals method on contract and returns value in result data
Steps to Test
yarn test packages/source/view-function-multi-chain/test
Quality Assurance
infra-k8s
configuration file.adapter-secrets
configuration file or update the soak testing blacklist.test-payload.json
file with relevant requests.feature/x
,chore/x
,release/x
,hotfix/x
,fix/x
) or is created from Jira.