Skip to content

Commit

Permalink
fix: pactffi_given_with_params accepts 3 args
Browse files Browse the repository at this point in the history
  • Loading branch information
mefellows committed Jan 22, 2024
1 parent 5720d25 commit a56fdf7
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions native/consumer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,8 @@ Napi::Value PactffiGivenWithParam(const Napi::CallbackInfo& info) {
Napi::Value PactffiGivenWithParams(const Napi::CallbackInfo& info) {
Napi::Env env = info.Env();

if (info.Length() < 4) {
throw Napi::Error::New(env, "PactffiGivenWithParams received < 4 arguments");
if (info.Length() < 3) {
throw Napi::Error::New(env, "PactffiGivenWithParams received < 3 arguments");
}

if (!info[0].IsNumber()) {
Expand All @@ -720,10 +720,6 @@ Napi::Value PactffiGivenWithParams(const Napi::CallbackInfo& info) {
throw Napi::Error::New(env, "PactffiGivenWithParams(arg 2) expected a string");
}

if (!info[3].IsString()) {
throw Napi::Error::New(env, "PactffiGivenWithParams(arg 3) expected a string");
}

InteractionHandle interaction = info[0].As<Napi::Number>().Uint32Value();
std::string description = info[1].As<Napi::String>().Utf8Value();
std::string params = info[2].As<Napi::String>().Utf8Value();
Expand Down

0 comments on commit a56fdf7

Please sign in to comment.