Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: resolve style guide violations
Browse files Browse the repository at this point in the history
oXtxNt9U authored and github-actions[bot] committed Jan 31, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 521facc commit 991586e
Showing 8 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -108,4 +108,4 @@
"engines": {
"node": ">=20.x"
}
}
}
2 changes: 1 addition & 1 deletion packages/crypto-address-base58/source/index.ts
Original file line number Diff line number Diff line change
@@ -5,8 +5,8 @@ import { AddressFactory } from "./address.factory.js";
import { schemas } from "./schemas.js";
import { AddressSerializer } from "./serializer.js";

export * from "./schemas.js";
export * from "./address.factory.js";
export * from "./schemas.js";

export class ServiceProvider extends Providers.ServiceProvider {
public async register(): Promise<void> {
6 changes: 3 additions & 3 deletions packages/crypto-legacy-support/package.json
Original file line number Diff line number Diff line change
@@ -23,13 +23,13 @@
},
"dependencies": {
"@mainsail/contracts": "workspace:*",
"@mainsail/kernel": "workspace:*",
"@mainsail/crypto-address-base58": "workspace:*"
"@mainsail/crypto-address-base58": "workspace:*",
"@mainsail/kernel": "workspace:*"
},
"devDependencies": {
"uvu": "^0.5.6"
},
"engines": {
"node": ">=20.x"
}
}
}
2 changes: 1 addition & 1 deletion packages/crypto-legacy-support/source/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Identifiers } from "@mainsail/contracts";
import { Providers } from "@mainsail/kernel";
import { AddressFactory as Base58AddressFactory } from "@mainsail/crypto-address-base58";
import { Providers } from "@mainsail/kernel";

export class ServiceProvider extends Providers.ServiceProvider {
public async register(): Promise<void> {
Original file line number Diff line number Diff line change
@@ -41,10 +41,10 @@ export class EvmCallTransactionHandler extends Handlers.TransactionHandler {
const { receipt } = await instance.process({
blockContext,
caller: senderAddress,
legacyAddress: senderLegacyAddress,
data: Buffer.from(transaction.data.data, "hex"),
gasLimit: BigInt(transaction.data.gasLimit),
gasPrice: BigInt(transaction.data.gasPrice),
legacyAddress: senderLegacyAddress,
nonce: transaction.data.nonce.toBigInt(),
recipient: transaction.data.recipientAddress,
sequence: transaction.data.sequence,
29 changes: 17 additions & 12 deletions packages/crypto-transaction/source/validation/schemas.ts
Original file line number Diff line number Diff line change
@@ -28,24 +28,24 @@ export const transactionBaseSchema: SchemaObject = {
gasLimit: { transactionGasLimit: {} },
gasPrice: { transactionGasPrice: {} },
id: { anyOf: [{ $ref: "transactionId" }, { type: "null" }] },
network: { $ref: "networkByte" },

nonce: { bignumber: { minimum: 0 } },
r: { type: "string" }, // TODO: prefixed hex
s: { type: "string" },
senderAddress: { $ref: "address" },

senderPublicKey: { $ref: "publicKey" },
v: { maximum: 28, minimum: 27, type: "number" },

value: { bignumber: { maximum: undefined, minimum: 0 } },

// Legacy
legacySecondSignature: {
// TODO: double check format
allOf: [{ maxLength: 130, minLength: 130 }, { $ref: "alphanumeric" }],
type: "string",
},

network: { $ref: "networkByte" },

nonce: { bignumber: { minimum: 0 } },

r: { type: "string" },

// TODO: prefixed hex
s: { type: "string" },

senderAddress: { $ref: "address" },

senderLegacyAddress: {
allOf: [
{
@@ -56,6 +56,11 @@ export const transactionBaseSchema: SchemaObject = {
],
type: "string",
},

senderPublicKey: { $ref: "publicKey" },

v: { maximum: 28, minimum: 27, type: "number" },
value: { bignumber: { maximum: undefined, minimum: 0 } },
// signatures: {
// items: { allOf: [{ maxLength: 130, minLength: 130 }, { $ref: "alphanumeric" }], type: "string" },
// maxItems: 16,
6 changes: 4 additions & 2 deletions packages/snapshot-legacy-importer/source/importer.ts
Original file line number Diff line number Diff line change
@@ -169,7 +169,9 @@ export class Importer implements Contracts.Snapshot.LegacyImporter {
}

if (wallet.attributes["delegate"]) {
if (!wallet.publicKey) throw new Error("delegate is missing public key");
if (!wallet.publicKey) {
throw new Error("delegate is missing public key");
}

validators.push({
arkAddress: wallet.address,
@@ -189,10 +191,10 @@ export class Importer implements Contracts.Snapshot.LegacyImporter {

this.logger.info(
`snapshot stats: ${JSON.stringify({
coldWallets: foundColdWallets,
validators: validators.length,
voters: voters.length,
wallets: wallets.length,
coldWallets: foundColdWallets,
})}`,
);

2 changes: 1 addition & 1 deletion packages/transactions/source/handlers/transaction.ts
Original file line number Diff line number Diff line change
@@ -68,10 +68,10 @@ export abstract class TransactionHandler implements Contracts.Transactions.Trans
const preverified = await evm.preverifyTransaction({
blockGasLimit: BigInt(milestone.block.maxGasLimit),
caller: transaction.data.senderAddress,
legacyAddress: transaction.data.senderLegacyAddress,
data: Buffer.from(transaction.data.data, "hex"),
gasLimit: BigInt(transaction.data.gasLimit),
gasPrice: BigInt(transaction.data.gasPrice),
legacyAddress: transaction.data.senderLegacyAddress,
nonce: transaction.data.nonce.toBigInt(),
recipient: transaction.data.recipientAddress,
specId: milestone.evmSpec,

0 comments on commit 991586e

Please sign in to comment.