Skip to content

Commit

Permalink
fix syscall signature
Browse files Browse the repository at this point in the history
  • Loading branch information
douyixuan committed Sep 7, 2024
1 parent 7a509f9 commit e909445
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/ckb/syscalls.cell
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func loadInput(index uint64, source uint64) []byte {
return data
}
// header is a sub-structure of block and UncleBlock
func loadHeader(index uint32, source uint32) []byte {
func loadHeader(index uint64, source uint64) []byte {
data := make([]byte, SIZE_HEADER, SIZE_HEADER)
ptr := __slice_get_ptr(&data)
size := SIZE_MAX
Expand All @@ -99,7 +99,7 @@ func loadHeader(index uint32, source uint32) []byte {
return data
}
// func load_witness(addr uintptr, len uint64, offset uint, index uint, source uint) int
func loadWitness(index uint32, source uint32) []byte {
func loadWitness(index uint64, source uint64) []byte {
data := make([]byte, SIZE_WITNESS, SIZE_WITNESS)
ptr := __slice_get_ptr(&data)
size := SIZE_MAX
Expand All @@ -110,8 +110,7 @@ func loadWitness(index uint32, source uint32) []byte {
__slice_set_len(&data, uint32(size))
return data
}
// func load_cell_data(addr uintptr, len uint64, offset uint, index uint, source uint) int
func loadCellData(index uint32, source uint32) []byte {
func loadCellData(index uint64, source uint64) []byte {
data := make([]byte, SIZE_DATA, SIZE_DATA)
ptr := __slice_get_ptr(&data)
size := SIZE_MAX
Expand All @@ -123,10 +122,10 @@ func loadCellData(index uint32, source uint32) []byte {
return data
}
// load cell data from cells grouped by script
func loadInputCellData(index uint32) []byte {
func loadInputCellData(index uint64) []byte {
return loadCellData(index, CKB_SOURCE_GROUP_INPUT)
}
func loadOutputCellData(index uint32) []byte {
func loadOutputCellData(index uint64) []byte {
return loadCellData(index, CKB_SOURCE_GROUP_OUTPUT)
}
func VMVersion() uint64 {
Expand All @@ -135,7 +134,7 @@ func VMVersion() uint64 {

// load cell as CellOutput pattern
// equals load cell by field {capacity, lock, type}
func inputCell(index uint) blockchain.CellOutput {
func inputCell(index uint64) blockchain.CellOutput {
data := make([]byte, SIZE_CELL, SIZE_CELL)
ptr := __slice_get_ptr(&data)
size := SIZE_MAX
Expand Down

0 comments on commit e909445

Please sign in to comment.