Optimize transaction creation #98
1 changed files with 16 additions and 15 deletions
|
@ -135,21 +135,22 @@ createTransaction ::
|
|||
-> IO (Either TxError HexString)
|
||||
createTransaction sapAnchor orchAnchor tSpend sSpend oSpend outgoing znet bh build = do
|
||||
txResult <-
|
||||
withBorshBufferOfInitSize 10240 $
|
||||
rustWrapperCreateTx
|
||||
(case sapAnchor of
|
||||
Nothing -> "0"
|
||||
Just sA -> toBytes $ sapTree sA)
|
||||
(case orchAnchor of
|
||||
Nothing -> "0"
|
||||
Just oA -> toBytes $ orchTree oA)
|
||||
tSpend
|
||||
sSpend
|
||||
oSpend
|
||||
outgoing
|
||||
(znet == MainNet)
|
||||
(fromIntegral bh)
|
||||
build
|
||||
do print "calling FFI"
|
||||
withBorshBufferOfInitSize 51200 $
|
||||
rustWrapperCreateTx
|
||||
(case sapAnchor of
|
||||
Nothing -> "0"
|
||||
Just sA -> toBytes $ sapTree sA)
|
||||
(case orchAnchor of
|
||||
Nothing -> "0"
|
||||
Just oA -> toBytes $ orchTree oA)
|
||||
tSpend
|
||||
sSpend
|
||||
oSpend
|
||||
outgoing
|
||||
(znet == MainNet)
|
||||
(fromIntegral bh)
|
||||
build
|
||||
if BS.length (hexBytes txResult) > 1
|
||||
then pure $ Right txResult
|
||||
else case head (BS.unpack $ hexBytes txResult) of
|
||||
|
|
Loading…
Reference in a new issue