tendermint-rpc: Update adaptorForVersion
This commit is contained in:
parent
2f2ecead94
commit
77602efa6d
@ -4,6 +4,10 @@
|
||||
import { Adaptor } from "./adaptor";
|
||||
import { v0_33 } from "./v0-33";
|
||||
|
||||
const hashes = {
|
||||
v0_34: ["ca2c9df"],
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns an Adaptor implementation for a given tendermint version.
|
||||
* Throws when version is not supported.
|
||||
@ -11,7 +15,7 @@ import { v0_33 } from "./v0-33";
|
||||
* @param version full Tendermint version string, e.g. "0.20.1"
|
||||
*/
|
||||
export function adaptorForVersion(version: string): Adaptor {
|
||||
if (version.startsWith("0.33.") || version.startsWith("0.34.")) {
|
||||
if (version.startsWith("0.33.") || version.startsWith("0.34.") || hashes.v0_34.includes(version)) {
|
||||
return v0_33;
|
||||
} else {
|
||||
throw new Error(`Unsupported tendermint version: ${version}`);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user