Skip to content

Commit 5c19699

Browse files
chore: rename newAt to createFromAddress (#446)
1 parent 5c01294 commit 5c19699

File tree

12 files changed

+21
-17
lines changed

12 files changed

+21
-17
lines changed

contracts/tests/lib/access/Ownable2Step.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ describe('Ownable2Step Counter', () => {
3333
}
3434

3535
bind.counter = blockchain.openContract(counter.ContractClient.newFrom(data, code))
36-
bind.ownable = blockchain.openContract(ownable2Step.ContractClient.newAt(bind.counter.address))
36+
bind.ownable = blockchain.openContract(
37+
ownable2Step.ContractClient.createFromAddress(bind.counter.address),
38+
)
3739

3840
const deployResult = await bind.counter.sendDeploy(deployer.getSender(), toNano('0.05'))
3941

contracts/tests/lib/deployable/Deployable.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe('Deployable - Unit Tests', () => {
7171
})
7272

7373
const counterContract = blockchain.openContract(
74-
counter.ContractClient.newAt(deployable.address),
74+
counter.ContractClient.createFromAddress(deployable.address),
7575
)
7676
expect(await counterContract.getValue()).toBe(0)
7777

@@ -129,7 +129,7 @@ describe('Deployable - Unit Tests', () => {
129129
})
130130

131131
const counterContract = blockchain.openContract(
132-
counter.ContractClient.newAt(deployable.address),
132+
counter.ContractClient.createFromAddress(deployable.address),
133133
)
134134
expect(await counterContract.getValue()).toBe(42)
135135
})

contracts/tests/mcms/BaseTest.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ export class BaseTestSetup {
176176
this.bind.timelock = this.blockchain.openContract(
177177
rbactl.ContractClient.newFrom(data, this.code.timelock),
178178
)
179-
this.bind.ac = this.blockchain.openContract(ac.ContractClient.newAt(this.bind.timelock.address))
179+
this.bind.ac = this.blockchain.openContract(
180+
ac.ContractClient.createFromAddress(this.bind.timelock.address),
181+
)
180182
}
181183

182184
/**

contracts/tests/mcms/Integration.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ describe('MCMS - IntegrationTest', () => {
184184
}
185185

186186
bind.timelock = blockchain.openContract(rbactl.ContractClient.newFrom(data, code.timelock))
187-
bind.ac = blockchain.openContract(ac.ContractClient.newAt(bind.timelock.address))
187+
bind.ac = blockchain.openContract(ac.ContractClient.createFromAddress(bind.timelock.address))
188188
}
189189

190190
// Set up Counter contract
@@ -286,7 +286,7 @@ describe('MCMS - IntegrationTest', () => {
286286

287287
// Transfer ownership to Timelock
288288
const addr = bind.mcmsPropose.address
289-
const ownable = blockchain.openContract(ownable2step.ContractClient.newAt(addr))
289+
const ownable = blockchain.openContract(ownable2step.ContractClient.createFromAddress(addr))
290290
await transferOwnershipToTimelock(ownable)
291291
}
292292

@@ -333,7 +333,7 @@ describe('MCMS - IntegrationTest', () => {
333333

334334
// Transfer ownership to Timelock
335335
const addr = bind.mcmsVeto.address
336-
const ownable = blockchain.openContract(ownable2step.ContractClient.newAt(addr))
336+
const ownable = blockchain.openContract(ownable2step.ContractClient.createFromAddress(addr))
337337
await transferOwnershipToTimelock(ownable)
338338
}
339339

@@ -384,7 +384,7 @@ describe('MCMS - IntegrationTest', () => {
384384

385385
// Transfer ownership to Timelock
386386
const addr = bind.mcmsBypass.address
387-
const ownable = blockchain.openContract(ownable2step.ContractClient.newAt(addr))
387+
const ownable = blockchain.openContract(ownable2step.ContractClient.createFromAddress(addr))
388388
await transferOwnershipToTimelock(ownable)
389389
}
390390

@@ -402,7 +402,7 @@ describe('MCMS - IntegrationTest', () => {
402402
expect(await bind.counter.getValue()).toEqual(0)
403403
expect(
404404
await blockchain
405-
.openContract(ownable2step.ContractClient.newAt(bind.counter.address))
405+
.openContract(ownable2step.ContractClient.createFromAddress(bind.counter.address))
406406
.getOwner(),
407407
).toEqual(bind.timelock.address)
408408
}

contracts/tests/mcms/RBACTimelock.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('RBACTimelock', () => {
6363
}
6464

6565
timelock = blockchain.openContract(rbactl.ContractClient.newFrom(data, code))
66-
acContract = blockchain.openContract(ac.ContractClient.newAt(timelock.address))
66+
acContract = blockchain.openContract(ac.ContractClient.createFromAddress(timelock.address))
6767
})
6868

6969
it('should compute error code', async () => {

contracts/wrappers/examples/Counter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export class ContractClient implements Contract, typeAndVersion.Interface {
121121
readonly init?: { code: Cell; data: Cell },
122122
) {}
123123

124-
static newAt(address: Address): ContractClient {
124+
static createFromAddress(address: Address): ContractClient {
125125
return new ContractClient(address)
126126
}
127127

contracts/wrappers/lib/access/AccessControl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export const builder = {
201201
export class ContractClient implements Contract {
202202
constructor(readonly address: Address) {}
203203

204-
static newAt(address: Address): ContractClient {
204+
static createFromAddress(address: Address): ContractClient {
205205
return new ContractClient(address)
206206
}
207207

contracts/wrappers/libraries/access/Ownable2Step.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export class ContractClient implements Contract, Interface {
119119
readonly init?: { code: Cell; data: Cell },
120120
) {}
121121

122-
static newAt(address: Address): ContractClient {
122+
static createFromAddress(address: Address): ContractClient {
123123
return new ContractClient(address)
124124
}
125125

contracts/wrappers/mcms/MCMS.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ export class ContractClient implements Contract {
905905
readonly init?: { code: Cell; data: Cell },
906906
) {}
907907

908-
static newAt(address: Address): ContractClient {
908+
static createFromAddress(address: Address): ContractClient {
909909
return new ContractClient(address)
910910
}
911911

contracts/wrappers/mcms/RBACTimelock.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ export class ContractClient implements Contract {
797797
readonly init?: { code: Cell; data: Cell },
798798
) {}
799799

800-
static newAt(address: Address): ContractClient {
800+
static createFromAddress(address: Address): ContractClient {
801801
return new ContractClient(address)
802802
}
803803

0 commit comments

Comments
 (0)