Skip to content

Commit 7d5ec63

Browse files
committed
refactor(config): Chain.toString() returns lowercased chain name
1 parent 664d8b5 commit 7d5ec63

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/config/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class Chain implements ChainJSON {
6868
}
6969

7070
toString(): string {
71-
return this.name
71+
return this.name.toLowerCase()
7272
}
7373
}
7474

packages/config/test/index.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,8 @@ describe("Load configuration from JSON file", () => {
3838
const chain = chains["polygon"]
3939
assert.equal(chain.toString(), "polygon")
4040
})
41+
it("Chain.toString() returns the name of the chain in lowercase", () => {
42+
const chain = new config.Chain("GNOSIS", 123, new Array<config.RPCEndpoint>(), new config.Contracts())
43+
assert.equal(chain.toString(), "gnosis")
44+
})
4145
})

0 commit comments

Comments
 (0)