Skip to content

Commit

Permalink
Check for accessListLength to determine tx type
Browse files Browse the repository at this point in the history
  • Loading branch information
Inkvi committed Jun 27, 2024
1 parent ce7e715 commit fd151a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ const main = async () => {
const kzg = await loadKZG()

let batcherAddress = '0xb79c84166a348b38894bafa95b4f8e286e325e1e';
const txType: number = 3;
const txType: number = 2;

const url = 'http://127.0.0.1:8000'; // Change the URL accordingly
const rpc = "https://eth-sepolia.public.blastapi.io"
const rpc = "https://1rpc.io/sepolia"
const web3 = new Web3(rpc);
const provider = new ethers.JsonRpcProvider(rpc);

Expand Down
9 changes: 7 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ const app = fastify({
logger: true,
});

const kmsProvider = new KMSProviderGCP({});
const gcpConfig = {
keyFilename: "/Users/inkvi/dev/signer-service/keyfile.json"
};
const kmsProvider = new KMSProviderGCP(gcpConfig);

// const kmsProvider = new KMSProviderGCP({});
const wallets = new KMSWallets(kmsProvider);

let PROJECT_ID = process.env.PROJECT_ID!
Expand Down Expand Up @@ -66,7 +71,7 @@ async function handleEthSignTransaction(transactionArgs: TransactionArgs) {
transactionArgs.type = '0x0';
}

if (transactionArgs.accessList) {
if (transactionArgs.accessList && transactionArgs.accessList.length > 0) {
transactionArgs.type = '0x1';
} else if (transactionArgs.blobVersionedHashes && transactionArgs.blobVersionedHashes.length > 0) {
transactionArgs.type = '0x3';
Expand Down

0 comments on commit fd151a0

Please sign in to comment.