Skip to content

Commit

Permalink
add soroban multi signing
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-rogobete committed Sep 18, 2023
1 parent 83f3e37 commit a242bb6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions lib/src/soroban/soroban_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,12 @@ class SorobanAuthorizationEntry {
Uint8List signatureBytes = signer.sign(payload);
AccountEd25519Signature signature =
AccountEd25519Signature(signer.xdrPublicKey, signatureBytes);
credentials.addressCredentials!.signature = signature.toXdrSCVal();
List<XdrSCVal> signatures = List<XdrSCVal>.empty(growable: true);
if (credentials.addressCredentials!.signature.vec != null) {
signatures.addAll(credentials.addressCredentials!.signature.vec!);
}
signatures.add(signature.toXdrSCVal());
credentials.addressCredentials!.signature = XdrSCVal.forVec(signatures);
}
}

Expand All @@ -330,7 +335,6 @@ class AccountEd25519Signature {
XdrSCMapEntry(XdrSCVal.forSymbol("public_key"), pkVal);
XdrSCMapEntry sigEntry =
XdrSCMapEntry(XdrSCVal.forSymbol("signature"), sigVal);
XdrSCVal map = XdrSCVal.forMap([pkEntry, sigEntry]);
return XdrSCVal.forVec([map]);
return XdrSCVal.forMap([pkEntry, sigEntry]);
}
}
2 changes: 1 addition & 1 deletion lib/src/xdr/xdr_transaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ class XdrTransactionResultCode {
case -14:
return txBAD_SPONSORSHIP;
case -15:
return txBAD_MIN_SEQ_AGE_OR_GAP;
return txMALFORMED;
case -16:
return txBAD_MIN_SEQ_AGE_OR_GAP;
case -17:
Expand Down

0 comments on commit a242bb6

Please sign in to comment.