-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<feat>(transaction): add interfaces of new transaction manager.
- Loading branch information
Showing
25 changed files
with
2,099 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,51 @@ | ||
package org.fisco.bcos.sdk.v3.codec; | ||
|
||
import org.fisco.bcos.sdk.v3.crypto.CryptoSuite; | ||
import org.fisco.bcos.sdk.v3.crypto.hash.Hash; | ||
import org.fisco.bcos.sdk.v3.crypto.hash.Keccak256; | ||
import org.fisco.bcos.sdk.v3.crypto.hash.SM3Hash; | ||
import org.fisco.bcos.sdk.v3.model.CryptoType; | ||
|
||
public class Encoder { | ||
private CryptoSuite cryptoSuite; | ||
|
||
private Hash hashImpl; | ||
|
||
@Deprecated | ||
public Encoder(CryptoSuite cryptoSuite) { | ||
this.cryptoSuite = cryptoSuite; | ||
this.hashImpl = cryptoSuite.getHashImpl(); | ||
} | ||
|
||
public Encoder(Hash hash) { | ||
// for compatibility | ||
if (hashImpl instanceof SM3Hash) { | ||
this.cryptoSuite = new CryptoSuite(CryptoType.SM_TYPE); | ||
} | ||
if (hashImpl instanceof Keccak256) { | ||
this.cryptoSuite = new CryptoSuite(CryptoType.ECDSA_TYPE); | ||
} | ||
this.hashImpl = hash; | ||
} | ||
|
||
/** @return the cryptoSuite */ | ||
@Deprecated | ||
public CryptoSuite getCryptoSuite() { | ||
return this.cryptoSuite; | ||
} | ||
|
||
/** @param cryptoSuite the cryptoSuite to set */ | ||
@Deprecated | ||
public void setCryptoSuite(CryptoSuite cryptoSuite) { | ||
this.cryptoSuite = cryptoSuite; | ||
this.hashImpl = cryptoSuite.getHashImpl(); | ||
} | ||
|
||
public Hash getHashImpl() { | ||
return hashImpl; | ||
} | ||
|
||
public void setHashImpl(Hash hashImpl) { | ||
this.hashImpl = hashImpl; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.