Skip to content

Commit

Permalink
fix extern func call
Browse files Browse the repository at this point in the history
  • Loading branch information
douyixuan committed Sep 7, 2024
1 parent 45a122a commit f079f5c
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/ckb/syscalls.cell
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func loadTxHash() blockchain.Byte32 {
if err != CKB_SUCCESS {
return blockchain.Byte32Default()
}
__slice_set_len(&data, size)
__slice_set_len(&data, uint32(size))
return blockchain.Byte32FromSliceUnchecked(data)
}
func loadTx() []byte {
Expand All @@ -43,7 +43,7 @@ func loadTx() []byte {
if err != CKB_SUCCESS {
return []byte{}
}
__slice_set_len(&data, size)
__slice_set_len(&data, uint32(size))
// pack into a transaction
// Fileds - RawTx - Tx
// builder := blockchain.NewTransactionBuilder()
Expand All @@ -59,7 +59,7 @@ func loadScriptHash() blockchain.Byte32 {
if err != CKB_SUCCESS {
return blockchain.Byte32Default()
}
__slice_set_len(&data, size)
__slice_set_len(&data, uint32(size))
return blockchain.Byte32FromSliceUnchecked(data)
}
func loadScript() blockchain.Script {
Expand All @@ -73,7 +73,7 @@ func loadScript() blockchain.Script {
if size > SIZE_SCRIPT {
return blockchain.ScriptDefault()
}
__slice_set_len(&data, size)
__slice_set_len(&data, uint32(size))
return blockchain.ScriptFromSliceUnchecked(data)
}
func loadInput(index uint32, source uint32) []byte {
Expand All @@ -95,7 +95,7 @@ func loadHeader(index uint32, source uint32) []byte {
if err != CKB_SUCCESS {
return []byte{}
}
__slice_set_len(&data, size)
__slice_set_len(&data, uint32(size))
return data
}
// func load_witness(addr uintptr, len uint64, offset uint, index uint, source uint) int
Expand All @@ -107,7 +107,7 @@ func loadWitness(index uint32, source uint32) []byte {
if err != CKB_SUCCESS {
return []byte{}
}
__slice_set_len(&data, size)
__slice_set_len(&data, uint32(size))
return data
}
// func load_cell_data(addr uintptr, len uint64, offset uint, index uint, source uint) int
Expand All @@ -119,7 +119,7 @@ func loadCellData(index uint32, source uint32) []byte {
if err != CKB_SUCCESS {
return []byte{}
}
__slice_set_len(&data, size)
__slice_set_len(&data, uint32(size))
return data
}
// load cell data from cells grouped by script
Expand All @@ -143,7 +143,7 @@ func inputCell(index uint) blockchain.CellOutput {
if err != CKB_SUCCESS {
return blockchain.CellOutputDefault()
}
__slice_set_len(&data, size)
__slice_set_len(&data, uint32(size))
return blockchain.CellOutputFromSliceUnchecked(data)
}
func txInputCells() uint64 {
Expand Down

0 comments on commit f079f5c

Please sign in to comment.