Skip to content

Commit 1f37aa0

Browse files
committed
Test that token clawback rejects muxed sources.
1 parent a046ce3 commit 1f37aa0

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

  • cmd/crates/soroban-test/tests/it/integration/token

‎cmd/crates/soroban-test/tests/it/integration/token/clawback.rs‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,27 @@ async fn clawback_fails_when_sac_not_deployed() {
8686
);
8787
}
8888

89+
#[tokio::test]
90+
async fn clawback_rejects_muxed_source_with_clear_error() {
91+
let sandbox = &TestEnv::new();
92+
let holder = new_account(sandbox, "holder");
93+
94+
// Muxed (M…) source accounts aren't supported by the invoke pipeline yet
95+
// (see #2645). Until then the command must reject them up front with a clear
96+
// message rather than a raw strkey decode error deep in the pipeline.
97+
let muxed = "MA3D5KRYM6CB7OWQ6TWYRR3Z4T7GNZLKERYNZGGA5SOAOPIFY6YQGAAAAAAAAAPCICBKU";
98+
sandbox
99+
.new_assert_cmd("token")
100+
.args([
101+
"clawback", "--id", "native", "--admin", muxed, "--from", &holder, "--amount", "1",
102+
])
103+
.assert()
104+
.failure()
105+
.stderr(predicates::str::contains(
106+
"muxed (M…) source accounts are not yet supported",
107+
));
108+
}
109+
89110
#[tokio::test]
90111
async fn clawback_rejects_negative_amount_before_any_rpc() {
91112
let sandbox = &TestEnv::new();

0 commit comments

Comments
 (0)