Conversation
| gasLimit = uint64(gl) | ||
| } | ||
| version := uint32(1) | ||
| version := uint32(2) |
There was a problem hiding this comment.
here we are hardcoding to relayed. lower, in the facilitator we have a conditional if s.signer != nil and we choose between signing a relayed transaction and simple. also, in our docs we have this: assetTransferMethod: "direct/relayed". I think this should be the source of truth. So on this case, we should use that field and set the correct version
There was a problem hiding this comment.
Can we please assume a type and use that type only and error if we cannot cast to it? It looks ugly to try and cast every size possible
| } | ||
| } | ||
| } | ||
| relayer, _ := requirements.Extra["relayer"].(string) |
There was a problem hiding this comment.
we need to fix this, it casts it two times. once, and error if not ok
There was a problem hiding this comment.
can we cast directly to []string and remove the if argStr, ok := arg.(string); ok {?
There was a problem hiding this comment.
I think this is not correct as it can be a SC call. And the info in how much that SC call would cost would be in our Extra field which is handled above. We can handle there also the native vs esdt
There was a problem hiding this comment.
I do not think it is in the extra field, it is in the gasLimit field.
There was a problem hiding this comment.
so I removed gasLimit completely.
There was a problem hiding this comment.
"Empty slice declaration using a literal " warning (optional to fix)
There was a problem hiding this comment.
Optional: If not too much overhead (since there are a lot of fields) it would be nice if we can refactor this if/else to some helper functions, like:
if if asset == multiversx.NativeTokenTicker {
receiver, value, gaslLimit, data := s.getArgumentsForNativeTransfert(...)
} else {
.... := s.getArgumentsForESDT(...)
}I think it would be easier to read through
|
|
||
| hash, err := s.proxy.SendTransaction(ctx, &tx) | ||
| var hash string | ||
| if s.signer != nil { |
There was a problem hiding this comment.
We should use transfer type here and return error if we don't have a signer (to be consistent)
| } | ||
|
|
||
| // Ensure empty string if still missing (simulation requirement if not signed) | ||
| if tx.RelayerSignature == "" { |
Description
Tests
Checklist