chore: upgrade 2412 #14
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Notable changes to pallet-revive:
New runtime-apis:
Balance
The comment doesnt specify wether it wants the balance in ETH decimals or Native.. After a search at the only other implementation of this i could find: here i gather it is the balance as EVM units as it calls:
Since this
evm_balancedoes not exist in revive 0.4.0 i have implemented myown convert_native_to_evmdirectly in the api..Nonce
Essentially convert the H160 address to the runtime's address and read the nonce.
Eth transact
Again the only other reference i had for this was here .Since many of the api paramters match the call to
Revive::bare_eth_transacti only had to convert the H160 address to the standard runtimeAccountIdand give a closure for the utx encoded size.Config items
AddressGeneratorhas been removedMaxCodeLenhas been removedMigrationshas been removedAddressMapperhas been added. AccountId32Mapper is "The mapper to be used if the account id isAccountId32." Simple enough.ChainIdis used as a unique identifier assigned to each blockchain, used for preventing replay attacks. I have set is as 1 for the meantime.Finally
NativeToEthRatiohas been added refwhich i have defined as the
ETH_UNIT / UNIT. It is used to convert from a Native balance Unit to an Eth balance Unit.[sc-1937]