Skip to content

Commit

Permalink
Fix: message.chain=ETH for all EVM chains messages (else rejected)
Browse files Browse the repository at this point in the history
  • Loading branch information
philogicae committed Sep 2, 2024
1 parent bcbbbfb commit 711cefd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/message/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
},
"peerDependencies": {
"@aleph-sdk/account": "^1.x.x",
"@aleph-sdk/core": "^1.x.x"
"@aleph-sdk/core": "^1.x.x",
"@aleph-sdk/evm": "^1.x.x"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
4 changes: 3 additions & 1 deletion packages/message/src/utils/messageBuilder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { Account } from '@aleph-sdk/account'
import { Blockchain } from '@aleph-sdk/core'
import { EVMAccount } from '@aleph-sdk/evm'
import { BuiltMessage, ItemType, MessageContent, MessageType } from '../types'
import { PostContent } from '../post'
import { AggregateContent } from '../aggregate'
Expand All @@ -17,7 +19,7 @@ export type MessageBuilderConfig<C> = {

function buildMessage<C extends MessageContent>(config: MessageBuilderConfig<C>, type: MessageType): BuiltMessage<C> {
return new BuiltMessage<C>({
chain: config.account.getChain(),
chain: config.account instanceof EVMAccount ? Blockchain.ETH : config.account.getChain(),
sender: config.account.address,
channel: config.channel,
time: config.timestamp,
Expand Down

0 comments on commit 711cefd

Please sign in to comment.