requestNetwork
requestNetwork copied to clipboard
feat: any to near advanced logic
- Add the advanced logic extensions for payment with conversion for native token.
- Add the native token near specific case
- Add the associated tests
Coverage increased (+0.2%) to 88.465% when pulling 2f926c8f9b2f266233855664dcec00d3585ecafe on feat-any-to-near-advanced-logic into 97ee4354aac4b9f9583deec27505581b97e0799e on master.
Code is great! I'm just missing some context:
- What is this PN adding that any-to-eth-proxy does not support, apart from the fact that this is not for EVM?
- What was the reason for adding this PN? (what feature is missing)
- Maybe add the specs for any-to-native to clarify
@alexandre-abrioux
- any-to-eth was EVM specific, this adds a generic PN (any-to-native) that can be used as a base to create other PN - any-to-near in this case, but we could also base any-to-eth on it.
- For supporting any-to-near, we needed a new PN since some checks are network related, like the address validation.
- I'll have to update the specs yes
@yomarion
I've made an update based on Alex comments that checks that network
is define within the throwIfInvalidNetwork
function.
It makes this test fail https://github.com/RequestNetwork/requestNetwork/blob/master/packages/advanced-logic/test/extensions/payment-network/native-token.test.ts#L177
Are there any reason behind this test ? It looks a bit weird to me.
@yomarion I've made an update based on Alex comments that checks that
network
is define within thethrowIfInvalidNetwork
function. It makes this test fail https://github.com/RequestNetwork/requestNetwork/blob/master/packages/advanced-logic/test/extensions/payment-network/native-token.test.ts#L177 Are there any reason behind this test ? It looks a bit weird to me.
I think it's to cover this case:
- I create a request with a currency & network, without advanced-logic
- I add an extension to the advanced logic, with a createAction. This action does not have to have a network, we get it from the request
@yomarion I've made an update based on Alex comments that checks that
network
is define within thethrowIfInvalidNetwork
function. It makes this test fail https://github.com/RequestNetwork/requestNetwork/blob/master/packages/advanced-logic/test/extensions/payment-network/native-token.test.ts#L177 Are there any reason behind this test ? It looks a bit weird to me.I think it's to cover this case:
- I create a request with a currency & network, without advanced-logic
- I add an extension to the advanced logic, with a createAction. This action does not have to have a network, we get it from the request
Note: We discussed this with Yoann and decided to go forward and remove the test