Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yrong committed Feb 24, 2023
1 parent 01d5dab commit 6e8069a
Show file tree
Hide file tree
Showing 8 changed files with 211 additions and 12 deletions.
201 changes: 199 additions & 2 deletions relayer/contracts/basic/inbound.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions relayer/contracts/generate.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:generate bash -c "jq .abi ../../core/packages/contracts/artifacts/contracts/utils/OpaqueProof.sol/OpaqueProof.json | abigen --abi - --type OpaqueProof --pkg opaqueproof --out opaqueproof/contract.go"
//go:generate bash -c "jq .abi ../../core/packages/contracts/artifacts/contracts/BeefyClient.sol/BeefyClient.json | abigen --abi - --type BeefyClient --pkg beefyclient --out beefyclient/contract.go"
//go:generate bash -c "jq .abi ../../core/packages/contracts/artifacts/contracts/BasicInboundChannel.sol/BasicInboundChannel.json | abigen --abi - --type BasicInboundChannel --pkg basic --out basic/inbound.go"
//go:generate bash -c "jq .abi ../../core/packages/contracts/artifacts/contracts/BasicOutboundChannel.sol/BasicOutboundChannel.json | abigen --abi - --type BasicOutboundChannel --pkg basic --out basic/outbound.go"
//go:generate bash -c "jq .abi ../../core/packages/contracts/out/OpaqueProof.sol/OpaqueProof.json | abigen --abi - --type OpaqueProof --pkg opaqueproof --out opaqueproof/contract.go"
//go:generate bash -c "jq .abi ../../core/packages/contracts/out/BeefyClient.sol/BeefyClient.json | abigen --abi - --type BeefyClient --pkg beefyclient --out beefyclient/contract.go"
//go:generate bash -c "jq .abi ../../core/packages/contracts/out/BasicInboundChannel.sol/BasicInboundChannel.json | abigen --abi - --type BasicInboundChannel --pkg basic --out basic/inbound.go"
//go:generate bash -c "jq .abi ../../core/packages/contracts/out/BasicOutboundChannel.sol/BasicOutboundChannel.json | abigen --abi - --type BasicOutboundChannel --pkg basic --out basic/outbound.go"

package contracts
2 changes: 1 addition & 1 deletion relayer/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/magefile/mage v1.13.0
github.com/sirupsen/logrus v1.8.1
github.com/snowfork/ethashproof v0.0.0-20210729080250-93b61cd82454
github.com/snowfork/go-substrate-rpc-client/v4 v4.0.1-0.20230220165550-540414587385
github.com/snowfork/go-substrate-rpc-client/v4 v4.0.1-0.20230222084249-a54344a28717
github.com/spf13/cobra v1.4.0
github.com/spf13/viper v1.12.0
github.com/stretchr/testify v1.8.0
Expand Down
2 changes: 2 additions & 0 deletions relayer/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,8 @@ github.com/snowfork/go-substrate-rpc-client/v4 v4.0.1-0.20230220044419-4376f3e6a
github.com/snowfork/go-substrate-rpc-client/v4 v4.0.1-0.20230220044419-4376f3e6a023/go.mod h1:MVk5+w9icYU7MViYFm7CKYhx1VMj6DpN2tWO6s4OK5g=
github.com/snowfork/go-substrate-rpc-client/v4 v4.0.1-0.20230220165550-540414587385 h1:Tl5SWwJLIKASTKsv8F0Tg3iRAD3C4ORyJ4dMExoFZbs=
github.com/snowfork/go-substrate-rpc-client/v4 v4.0.1-0.20230220165550-540414587385/go.mod h1:MVk5+w9icYU7MViYFm7CKYhx1VMj6DpN2tWO6s4OK5g=
github.com/snowfork/go-substrate-rpc-client/v4 v4.0.1-0.20230222084249-a54344a28717 h1:lU66MVEQbBjLFD6idyESqCr43+nFp5K78RWtyzfeIZg=
github.com/snowfork/go-substrate-rpc-client/v4 v4.0.1-0.20230222084249-a54344a28717/go.mod h1:MVk5+w9icYU7MViYFm7CKYhx1VMj6DpN2tWO6s4OK5g=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spaolacci/murmur3 v1.0.1-0.20190317074736-539464a789e9/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
Expand Down
4 changes: 2 additions & 2 deletions relayer/relays/beefy/ethereum-writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ func (wr *EthereumWriter) doSubmitInitial(ctx context.Context, task *Request) (*
msg.Proof,
)
if err != nil {
return nil, nil, fmt.Errorf("initial submit: %w", err)
return nil, nil, fmt.Errorf("initial submit with handover: %w", err)
}
} else {
tx, err = wr.contract.SubmitInitial(
Expand Down Expand Up @@ -329,7 +329,7 @@ func (wr *EthereumWriter) doSubmitFinal(ctx context.Context, commitmentHash [32]

log.WithField("txHash", tx.Hash().Hex()).
WithFields(logFields).
Info("Sent SubmitFinal transaction")
Info("Sent SubmitFinalWithHandover transaction")

return tx, nil
} else { // revive:disable-line
Expand Down
2 changes: 1 addition & 1 deletion relayer/relays/beefy/polkadot-listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func (li *PolkadotListener) scanCommitments(
"blockNumber": result.SignedCommitment.Commitment.BlockNumber,
"validatorSetID": result.SignedCommitment.Commitment.ValidatorSetID,
},
}).Info("Discarded commitment")
}).Warn("Discarded commitment with depth not fast forward")
continue
}

Expand Down
2 changes: 1 addition & 1 deletion relayer/relays/parachain/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (wr *EthereumWriter) logFieldsForBasicSubmission(

params := log.Fields{
"message": log.Fields{
"sourceID": Hex(message.SourceId[:]),
"sourceID": Hex(message.SourceID[:]),
"nonce": message.Nonce,
"payload": message.Payload,
},
Expand Down
2 changes: 1 addition & 1 deletion relayer/relays/parachain/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ type BasicOutboundChannelMessage struct {

func (m BasicOutboundChannelMessage) IntoInboundMessage() basic.BasicInboundChannelMessage {
return basic.BasicInboundChannelMessage{
SourceId: m.SourceID,
SourceID: m.SourceID,
Nonce: (*big.Int)(&m.Nonce).Uint64(),
Payload: m.Payload,
}
Expand Down

0 comments on commit 6e8069a

Please sign in to comment.