Skip to content

Commit

Permalink
Fix personal_sign compatibility issues (#346)
Browse files Browse the repository at this point in the history
(cherry picked from commit e76436d)
Co-authored-by: sherard <xuxiaodong@starteos.io>
  • Loading branch information
sherardxu committed Nov 25, 2022
1 parent 6b06d4c commit e3f1b0a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ethereum_provider.js
Expand Up @@ -254,7 +254,12 @@ class TrustWeb3Provider extends BaseProvider {
}

personal_sign(payload) {
const message = payload.params[0];
var message;
if (this.address === payload.params[0]) {
message = payload.params[1];
} else {
message = payload.params[0];
}
const buffer = Utils.messageToBuffer(message);
if (buffer.length === 0) {
// hex it
Expand Down

0 comments on commit e3f1b0a

Please sign in to comment.