Skip to content

Commit

Permalink
Renamed chunk to TickmapChunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Sniezka1927 committed Feb 26, 2024
1 parent 43e9c11 commit dbe4f5b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions contracts/collections/tickmap.ral
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ Contract Tickmap(
if (!exists) {
return 0
} else {
let contract = Chunk(subContractId)
let contract = TickmapChunk(subContractId)
return contract.get()
}
}
Expand All @@ -207,7 +207,7 @@ Contract Tickmap(
let id = poolKey ++ toByteVec!(chunk)
let subContractId = subContractId!(id)
assert!(contractExists!(subContractId), TickmapErrors.ChunkNotFound)
let contract = Chunk(subContractId)
let contract = TickmapChunk(subContractId)

assert!(value == true && isInitialized == false || value == false && isInitialized == true, TickmapErrors.TickInitialized)

Expand All @@ -223,7 +223,7 @@ Contract Tickmap(
let exists = contractExists!(subContractId!(id))

if(!exists) {
let (encodedImmFields, encodedMutFields) = Chunk.encodeFields!(0, selfAddress!())
let (encodedImmFields, encodedMutFields) = TickmapChunk.encodeFields!(0, selfAddress!())
copyCreateSubContract!{caller -> ALPH: 1 alph}(
id,
chunkTemplateContractId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Contract Chunk(mut value: U256, admin: Address) {
enum ChunkError {
Contract TickmapChunk(mut value: U256, admin: Address) {
enum TickmapChunkError {
NotAdmin = 1100
}
pub fn get() -> U256 {
Expand All @@ -8,7 +8,7 @@ Contract Chunk(mut value: U256, admin: Address) {

@using(updateFields = true)
pub fn set(updatedValue: U256) -> () {
checkCaller!(callerAddress!() == admin, ChunkError.NotAdmin)
checkCaller!(callerAddress!() == admin, TickmapChunkError.NotAdmin)
value = updatedValue
}
}
4 changes: 2 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { NodeProvider, SignerProvider, ZERO_ADDRESS, node, web3 } from '@alephium/web3'
import {
CLAMM,
Chunk,
FeeTier,
FeeTiers,
Init,
Expand All @@ -14,6 +13,7 @@ import {
PositionsCounter,
SwapUtils,
Tickmap,
TickmapChunk,
Ticks
} from '../artifacts/ts'
import { Positions } from '../artifacts/ts/Positions'
Expand Down Expand Up @@ -286,7 +286,7 @@ export async function deployTick(signer: SignerProvider) {

export async function deployChunk(signer: SignerProvider) {
return await waitTxConfirmed(
Chunk.deploy(signer, {
TickmapChunk.deploy(signer, {
initialFields: {
value: 0n,
admin: ZERO_ADDRESS
Expand Down

0 comments on commit dbe4f5b

Please sign in to comment.