Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed chunk to TickmapChunk #31

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading