Skip to content

Commit f032333

Browse files
committed
refactor: rename generic method
The name of the method was too specific since it's a fairly generic method. It will be used by the claim function that is going to be introduced in the next commit.
1 parent 3930923 commit f032333

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export class HypercertClient implements HypercertClientInterface {
253253
}
254254

255255
const safeTransactions = new SafeTransactions(overrides.safeAddress, this._walletClient, this._getContract());
256-
return safeTransactions.mintHypercert(method, params, overrides);
256+
return safeTransactions.sendTransaction(method, params, overrides);
257257
}
258258

259259
const request = await this.simulateRequest(account, method, params, overrides);

src/safe/SafeTransactions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class SafeTransactions {
3030
});
3131
}
3232

33-
public mintHypercert = (
33+
public sendTransaction = (
3434
functionName: string,
3535
params: unknown[],
3636
overrides?: SupportedOverrides,

test/safe/transactions.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ describe("SafeTransactions", () => {
4040
} as any);
4141
});
4242

43-
describe("mintHypercert", () => {
43+
describe("sendTransaction", () => {
4444
const validParams = [senderAddress, 1000n, "0xcid", 0];
4545

4646
it("correctly encodes function data for transaction", async () => {
@@ -52,7 +52,7 @@ describe("SafeTransactions", () => {
5252
args: validParams,
5353
});
5454

55-
await safeTransactions.mintHypercert(functionName, validParams, {
55+
await safeTransactions.sendTransaction(functionName, validParams, {
5656
safeAddress,
5757
});
5858

@@ -70,7 +70,7 @@ describe("SafeTransactions", () => {
7070
it("uses correct nonce from API", async () => {
7171
safeApiKitStub.getNextNonce.resolves("42");
7272

73-
await safeTransactions.mintHypercert("mintClaim", validParams, {
73+
await safeTransactions.sendTransaction("mintClaim", validParams, {
7474
safeAddress,
7575
});
7676

@@ -95,7 +95,7 @@ describe("SafeTransactions", () => {
9595
);
9696

9797
try {
98-
await safeTransactions.mintHypercert("mintClaim", validParams, { safeAddress });
98+
await safeTransactions.sendTransaction("mintClaim", validParams, { safeAddress });
9999
expect.fail("Should throw ClientError");
100100
} catch (e) {
101101
expect(e).to.be.instanceOf(ClientError);
@@ -104,7 +104,7 @@ describe("SafeTransactions", () => {
104104
});
105105

106106
it("follows complete transaction flow", async () => {
107-
const hash = await safeTransactions.mintHypercert("mintClaim", validParams, {
107+
const hash = await safeTransactions.sendTransaction("mintClaim", validParams, {
108108
safeAddress,
109109
});
110110

@@ -123,7 +123,7 @@ describe("SafeTransactions", () => {
123123
safeApiKitStub.proposeTransaction.rejects(new Error(errorMessage));
124124

125125
try {
126-
await safeTransactions.mintHypercert("mintClaim", validParams, { safeAddress });
126+
await safeTransactions.sendTransaction("mintClaim", validParams, { safeAddress });
127127
expect.fail("Should throw SafeTransactionError");
128128
} catch (e) {
129129
expect(e).to.be.instanceOf(SafeTransactionError);
@@ -142,7 +142,7 @@ describe("SafeTransactions", () => {
142142
connectedSafeStub.createTransaction.rejects(new Error(errorMessage));
143143

144144
try {
145-
await safeTransactions.mintHypercert("mintClaim", [senderAddress, 1000n, "0xcid", 0], { safeAddress });
145+
await safeTransactions.sendTransaction("mintClaim", [senderAddress, 1000n, "0xcid", 0], { safeAddress });
146146
expect.fail("Should throw SafeTransactionError");
147147
} catch (e) {
148148
expect(e).to.be.instanceOf(SafeTransactionError);
@@ -155,7 +155,7 @@ describe("SafeTransactions", () => {
155155
});
156156

157157
it("properly proposes transaction with correct parameters", async () => {
158-
await safeTransactions.mintHypercert("mintClaim", [senderAddress, 1000n, "0xcid", 0], { safeAddress });
158+
await safeTransactions.sendTransaction("mintClaim", [senderAddress, 1000n, "0xcid", 0], { safeAddress });
159159

160160
const proposeCall = safeApiKitStub.proposeTransaction.getCall(0);
161161
expect(proposeCall.args[0]).to.deep.include({

0 commit comments

Comments
 (0)