Skip to content

Commit 4b66232

Browse files
committed
sui-sdk-types: add support for CommandArgumentError::InvalidArgumentArity
1 parent 1c0e1f7 commit 4b66232

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

crates/sui-sdk-types/src/execution_status.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,10 @@ pub enum CommandArgumentError {
385385
/// Shared object operations such a wrapping, freezing, or converting to owned are not
386386
/// allowed.
387387
SharedObjectOperationNotAllowed,
388+
389+
/// Invalid argument arity. Expected a single argument but found a result that expanded to
390+
/// multiple arguments.
391+
InvalidArgumentArity,
388392
}
389393

390394
/// An error with a upgrading a package
@@ -1280,6 +1284,7 @@ mod serialization {
12801284
InvalidObjectByValue,
12811285
InvalidObjectByMutRef,
12821286
SharedObjectOperationNotAllowed,
1287+
InvalidArgumentArity,
12831288
}
12841289

12851290
#[derive(serde_derive::Serialize, serde_derive::Deserialize)]
@@ -1296,6 +1301,7 @@ mod serialization {
12961301
InvalidObjectByValue,
12971302
InvalidObjectByMutRef,
12981303
SharedObjectOperationNotAllowed,
1304+
InvalidArgumentArity,
12991305
}
13001306

13011307
impl Serialize for CommandArgumentError {
@@ -1336,6 +1342,9 @@ mod serialization {
13361342
Self::SharedObjectOperationNotAllowed => {
13371343
ReadableCommandArgumentError::SharedObjectOperationNotAllowed
13381344
}
1345+
Self::InvalidArgumentArity => {
1346+
ReadableCommandArgumentError::InvalidArgumentArity
1347+
}
13391348
};
13401349
readable.serialize(serializer)
13411350
} else {
@@ -1366,6 +1375,7 @@ mod serialization {
13661375
Self::SharedObjectOperationNotAllowed => {
13671376
BinaryCommandArgumentError::SharedObjectOperationNotAllowed
13681377
}
1378+
Self::InvalidArgumentArity => BinaryCommandArgumentError::InvalidArgumentArity,
13691379
};
13701380
binary.serialize(serializer)
13711381
}
@@ -1411,6 +1421,9 @@ mod serialization {
14111421
ReadableCommandArgumentError::SharedObjectOperationNotAllowed => {
14121422
Self::SharedObjectOperationNotAllowed
14131423
}
1424+
ReadableCommandArgumentError::InvalidArgumentArity => {
1425+
Self::InvalidArgumentArity
1426+
}
14141427
}
14151428
})
14161429
} else {
@@ -1441,6 +1454,7 @@ mod serialization {
14411454
BinaryCommandArgumentError::SharedObjectOperationNotAllowed => {
14421455
Self::SharedObjectOperationNotAllowed
14431456
}
1457+
BinaryCommandArgumentError::InvalidArgumentArity => Self::InvalidArgumentArity,
14441458
})
14451459
}
14461460
}

0 commit comments

Comments
 (0)