feat: add length and concat to aiken/bytearray

This commit is contained in:
rvcas 2022-11-10 11:14:19 -05:00 committed by Lucas
parent b7edb7e584
commit 9f374d9431
2 changed files with 13 additions and 5 deletions

View File

@ -1,5 +1,13 @@
use aiken/builtins use aiken/builtin
pub fn slice(bytes: ByteArray, start: Int, end: Int) -> ByteArray { pub fn slice(bytes: ByteArray, start: Int, end: Int) -> ByteArray {
builtins.sliceByteString(start, end, bytes) builtin.sliceByteArray(start, end, bytes)
}
pub fn length(bytes: ByteArray) -> Int {
builtin.lengthOfByteArray(bytes)
}
pub fn concat(left front: ByteArray, right back: ByteArray) -> ByteArray {
builtin.appendByteArray(front, back)
} }

View File

@ -1,3 +1,3 @@
pub fn spend() -> Bool { pub fn spend(d: Nil, r: Nil, ctx: Nil) -> Bool {
True True
} }