Skip to content

Commit

Permalink
Async/Await fixup for Node 20
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Nov 30, 2023
1 parent 248f8c2 commit ae26bef
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/unit/server/simulate_transaction_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ const {
Networks,
SorobanDataBuilder,
authorizeInvocation,
authorizeEntry,
parseRawSimulation,
xdr
} = SorobanClient;

const randomSecret = Keypair.random().secret();

describe('Server#simulateTransaction', async function (done) {
describe('Server#simulateTransaction', async function(done) {
let keypair = Keypair.random();
let contractId = 'CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM';
let contract = new SorobanClient.Contract(contractId);
Expand Down Expand Up @@ -153,8 +154,6 @@ describe('Server#simulateTransaction', async function (done) {
});

xit('simulates fee bump transactions');

done();
});

function cloneSimulation(sim) {
Expand Down Expand Up @@ -195,10 +194,10 @@ async function buildAuthEntry(address) {

// do some voodoo to make this return a deterministic auth entry
const kp = Keypair.fromSecret(randomSecret);
let entry = authorizeInvocation(kp, 1, root);
entry.credentials().address().nonce(new xdr.Int64(0xdeadbeef));

return authorizeEntry(entry, kp, 1); // overwrites signature w/ above nonce
return authorizeInvocation(kp, 1, root).then(entry => {
entry.credentials().address().nonce(new xdr.Int64(0xdeadbeef));
return authorizeEntry(entry, kp, 1); // overwrites signature w/ above nonce
});
}

async function invokeSimulationResponse(address) {
Expand Down

0 comments on commit ae26bef

Please sign in to comment.