Skip to content

Commit

Permalink
ChainWriter unit tests (#948)
Browse files Browse the repository at this point in the history
* Added ChainWriter unit tests for GetFeeComponents and GetTransactionStatus

* Created SubmitTransaction tests

* Created SubmitTransaction tests

* Moved txm utils into own package and generated txm mock

* Updated chain writer tests to use txm mock

* Added GetAddresses unit test and fixed SubmitTransaction unit test

* Fixed linting and removed file read for IDL

* Fixed filter lookup table error case and fixed linting

* Added filter lookup table addresses unit tests

* Added new test case and fixed formatting issues

* Addressed golang lint suggestions

* Cleaned out unused dependency and fixed remaining golang lint errors

* Added derived lookup table indeces unit tests

---------

Co-authored-by: Silas Lenihan <[email protected]>
  • Loading branch information
amit-momin and silaslenihan committed Jan 3, 2025
1 parent 5a76e2c commit 5b17978
Show file tree
Hide file tree
Showing 8 changed files with 734 additions and 115 deletions.
7 changes: 6 additions & 1 deletion contracts/artifacts/localnet/write_test-keypair.json
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
[26,39,164,161,246,97,149,0,58,187,146,162,53,35,107,2,117,242,83,171,48,7,63,240,69,221,239,45,97,55,112,106,192,228,214,205,123,71,58,23,62,229,166,213,149,122,96,145,35,150,16,156,247,199,242,108,173,80,62,231,39,196,27,192]
[
26, 39, 164, 161, 246, 97, 149, 0, 58, 187, 146, 162, 53, 35, 107, 2, 117,
242, 83, 171, 48, 7, 63, 240, 69, 221, 239, 45, 97, 55, 112, 106, 192, 228,
214, 205, 123, 71, 58, 23, 62, 229, 166, 213, 149, 122, 96, 145, 35, 150, 16,
156, 247, 199, 242, 108, 173, 80, 62, 231, 39, 196, 27, 192
]
3 changes: 1 addition & 2 deletions contracts/programs/write_test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ pub mod write_test {
data.administrator = ctx.accounts.admin.key();
data.pending_administrator = Pubkey::default();
data.lookup_table = lookup_table;

Ok(())
}

}

#[derive(Accounts)]
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ require (
github.com/smartcontractkit/chainlink-common v0.4.1-0.20241223143929-db7919d60550
github.com/smartcontractkit/libocr v0.0.0-20241007185508-adbe57025f12
github.com/stretchr/testify v1.9.0
github.com/test-go/testify v1.1.4
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
golang.org/x/sync v0.10.0
Expand Down
Loading

0 comments on commit 5b17978

Please sign in to comment.